Skip to content

Commit d38bb53

Browse files
committed
SRP6: move botan-low-pwdhash-tests into the Tasty test component
1 parent 02099d4 commit d38bb53

File tree

3 files changed

+21
-25
lines changed

3 files changed

+21
-25
lines changed

botan-low/botan-low.cabal

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ test-suite test
147147

148148
other-modules:
149149
Test.Botan.Low.PwdHash
150+
Test.Botan.Low.SRP6
150151
Test.Prelude
151152

152153
--
@@ -744,27 +745,6 @@ test-suite botan-low-rng-tests
744745
NoImplicitPrelude
745746
OverloadedStrings
746747

747-
test-suite botan-low-srp6-tests
748-
import: warnings, language
749-
type: exitcode-stdio-1.0
750-
main-is: Botan/Low/SRP6Spec.hs
751-
hs-source-dirs: test/
752-
build-depends:
753-
, base
754-
, botan-low
755-
, bytestring
756-
, hspec
757-
, QuickCheck
758-
759-
other-modules:
760-
Paths_botan_low
761-
Test.Prelude
762-
763-
autogen-modules: Paths_botan_low
764-
default-extensions:
765-
NoImplicitPrelude
766-
OverloadedStrings
767-
768748
test-suite botan-low-totp-tests
769749
import: warnings, language
770750
type: exitcode-stdio-1.0

botan-low/test/Main.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Main (main) where
22

33
import qualified Test.Botan.Low.PwdHash
4+
import qualified Test.Botan.Low.SRP6
45
import Test.Tasty
56

67
main :: IO ()
@@ -9,6 +10,8 @@ main = tests >>= defaultMain
910
tests :: IO TestTree
1011
tests = do
1112
pwdHashTests <- Test.Botan.Low.PwdHash.tests
13+
srp6Tests <- Test.Botan.Low.SRP6.tests
1214
pure $ testGroup "botan-low" [
1315
pwdHashTests
16+
, srp6Tests
1417
]

botan-low/test/Botan/Low/SRP6Spec.hs renamed to botan-low/test/Test/Botan/Low/SRP6.hs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
module Main (main) where
1+
{-# LANGUAGE OverloadedStrings #-}
22

3-
import Test.Prelude
3+
module Test.Botan.Low.SRP6 (
4+
tests
5+
) where
46

57
import Botan.Low.Hash
68
import Botan.Low.PubKey
79
import Botan.Low.RNG
810
import Botan.Low.SRP6
11+
import Data.ByteString
12+
import Test.Prelude
13+
import Test.Tasty
14+
import Test.Tasty.Hspec
15+
16+
tests :: IO TestTree
17+
tests = do
18+
specs <- testSpec "spec_srp6" spec_srp6
19+
pure $ testGroup "Test.Botan.Low.SRP6" [
20+
specs
21+
]
922

1023
username :: ByteString
1124
username = "username"
@@ -47,8 +60,8 @@ groupIds =
4760
hashId :: HashName
4861
hashId = "SHA-256"
4962

50-
main :: IO ()
51-
main = hspec $ testSuite groupIds chars $ \ groupId -> do
63+
spec_srp6 :: Spec
64+
spec_srp6 = testSuite groupIds chars $ \ groupId -> do
5265
it "can negotiate a shared secret" $ do
5366
rng <- rngInit "system"
5467
verifier <- srp6GenerateVerifier username password salt groupId hashId

0 commit comments

Comments
 (0)