diff --git a/src/Enigma.hs b/Crypto/Enigma.hs similarity index 98% rename from src/Enigma.hs rename to Crypto/Enigma.hs index ef5e732..111c166 100644 --- a/src/Enigma.hs +++ b/Crypto/Enigma.hs @@ -1,7 +1,7 @@ -module Enigma where +module Crypto.Enigma where -import Helper +import Crypto.Enigma.Helper type State = [Char] -- state of the enigma machine data Direction = Fwd | Bwd deriving (Show, Eq) diff --git a/src/Helper.hs b/Crypto/Enigma/Helper.hs similarity index 98% rename from src/Helper.hs rename to Crypto/Enigma/Helper.hs index d384a84..ade6624 100644 --- a/src/Helper.hs +++ b/Crypto/Enigma/Helper.hs @@ -1,5 +1,5 @@ -module Helper where +module Crypto.Enigma.Helper where import Data.Char (ord, chr, isAsciiUpper) import Data.Maybe (fromMaybe) diff --git a/enigma-hs.cabal b/enigma-hs.cabal index 89796e8..344100b 100644 --- a/enigma-hs.cabal +++ b/enigma-hs.cabal @@ -15,21 +15,32 @@ build-type: Simple extra-source-files: README cabal-version: >=1.10 +library + ghc-options: -Wall + exposed-modules: Crypto.Enigma, Crypto.Enigma.Helper + exposed: True + -- other-modules: + -- other-extensions: + build-depends: base >=4.6 + default-language: Haskell2010 + executable enigma-hs ghc-options: -Wall main-is: Main.hs -- other-modules: -- other-extensions: - build-depends: base >=4.6 - hs-source-dirs: src + build-depends: base >=4.6, + enigma-hs + hs-source-dirs: tests default-language: Haskell2010 -test-suite enigma-test +test-suite tests ghc-options: -Wall type: exitcode-stdio-1.0 main-is: Test.hs - hs-source-dirs: src - build-depends: base >=4.6 + hs-source-dirs: tests + build-depends: base >=4.6, + enigma-hs default-language: Haskell2010 diff --git a/src/Main.hs b/tests/Main.hs similarity index 87% rename from src/Main.hs rename to tests/Main.hs index cec180a..5a6818c 100644 --- a/src/Main.hs +++ b/tests/Main.hs @@ -1,5 +1,5 @@ -import Enigma +import Crypto.Enigma confs :: (Conf, State) confs = intToSettingDefault 0 diff --git a/src/Test.hs b/tests/Test.hs similarity index 99% rename from src/Test.hs rename to tests/Test.hs index 2b451ac..4eb770d 100644 --- a/src/Test.hs +++ b/tests/Test.hs @@ -1,5 +1,5 @@ -import Enigma +import Crypto.Enigma import System.Exit (exitFailure, exitSuccess) -- general tests --------------------------------------------------------------