From f8a4f7e81c195ec0daa81e91b8a4cfa1ea093440 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Mon, 9 Nov 2020 15:24:48 -0500 Subject: [PATCH] created SubFix.Internal module --- src/SubFix/Internal.hs | 57 +++++++++++++++++++++++++++++++++++++ subfix.cabal | 5 +++- test/Spec.hs | 4 +-- test/SubFix/InternalSpec.hs | 28 ++++++++++++++++++ test/SubFixSpec.hs | 34 ++++++++++++++++++++++ 5 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 src/SubFix/Internal.hs create mode 100644 test/SubFix/InternalSpec.hs create mode 100644 test/SubFixSpec.hs diff --git a/src/SubFix/Internal.hs b/src/SubFix/Internal.hs new file mode 100644 index 0000000..444bf2b --- /dev/null +++ b/src/SubFix/Internal.hs @@ -0,0 +1,57 @@ +{-| +Module : SubFix.Internal +Description : core functions for subfix +Copyright : (C) Jonathan Lamothe +License : GPL-3 +Maintainer : jonathan@jlamothe.net + += IMPORTANT: + +THIS MODULE IS USED INTERNALLY AND MAY BE SUBJECT TO CHANGE WITHOUT +NOTICE! + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +-} + +module SubFix.Internal (encodeTime, decodeTime, timestamp) where + +-- | Encodes a timestamp from a number of milliseconds +encodeTime :: Integer -> String +encodeTime = undefined + +-- | Decodes a timestamp to a number of milliseconds and the unused +-- input +decodeTime + :: String + -- ^ The encoded timestamp + -> Maybe (Integer, String) + -- ^ The number of milliseconds and unused input (if available) +decodeTime = undefined + +-- | Converts hours, minutes, seconds and milliseconds into the total +-- number of milliseconds +timestamp + :: Integer + -- ^ Hours + -> Integer + -- ^ Minutes + -> Integer + -- ^ Seconds + -> Integer + -- ^ Milliseconds + -> Integer +timestamp = undefined + +--jl diff --git a/subfix.cabal b/subfix.cabal index d1753d1..0e5e5f8 100644 --- a/subfix.cabal +++ b/subfix.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 0bbe0a65faa072211284afd0838b32a74ded6fa51252fc0c023e92ba5da20c8f +-- hash: f83e79f4461abbbff9a3ec9abaae7602d26c2384e12b6f2236bc00dcca5ea136 name: subfix version: 0.0.0 @@ -30,6 +30,7 @@ source-repository head library exposed-modules: SubFix + SubFix.Internal other-modules: Paths_subfix hs-source-dirs: @@ -56,6 +57,8 @@ test-suite subfix-test main-is: Spec.hs other-modules: SubFix.ConvertSpec + SubFix.InternalSpec + SubFixSpec Paths_subfix hs-source-dirs: test diff --git a/test/Spec.hs b/test/Spec.hs index f9aec18..4948ed5 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -20,9 +20,9 @@ along with this program. If not, see . import Test.Hspec (hspec) -import qualified SubFix.ConvertSpec as Convert +import qualified SubFixSpec as SubFix main :: IO () -main = hspec Convert.spec +main = hspec SubFix.spec --jl diff --git a/test/SubFix/InternalSpec.hs b/test/SubFix/InternalSpec.hs new file mode 100644 index 0000000..1258c46 --- /dev/null +++ b/test/SubFix/InternalSpec.hs @@ -0,0 +1,28 @@ +{- + +subfix +Copyright (C) Jonathan Lamothe + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +-} + +module SubFix.InternalSpec (spec) where + +import Test.Hspec (Spec, describe) + +spec :: Spec +spec = describe "Internal" $ return () + +--jl diff --git a/test/SubFixSpec.hs b/test/SubFixSpec.hs new file mode 100644 index 0000000..7a30e16 --- /dev/null +++ b/test/SubFixSpec.hs @@ -0,0 +1,34 @@ +{- + +subfix +Copyright (C) Jonathan Lamothe + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +-} + +module SubFixSpec (spec) where + +import Test.Hspec (Spec, describe) + +import qualified SubFix.InternalSpec as Internal + +import qualified SubFix.ConvertSpec as Convert + +spec :: Spec +spec = describe "SubFix" $ do + Internal.spec + Convert.spec + +--jl