restructuring
- renamed newSalt to newPWSalt - added PWSalt type - general style cleanup
This commit is contained in:
10
test/Spec.hs
10
test/Spec.hs
@@ -27,8 +27,8 @@ import System.Exit (exitFailure)
|
||||
import Test.HUnit (errors, failures, runTestTT, Test(TestList))
|
||||
|
||||
import qualified Spec.NewPWData as NewPWData
|
||||
import qualified Spec.NewSalt as NewSalt
|
||||
import qualified Spec.PWPolicy as PWPolicy
|
||||
import qualified Spec.NewPWPolicy as NewPWPolicy
|
||||
import qualified Spec.NewPWSalt as NewPWSalt
|
||||
import qualified Spec.ValidatePWPolicy as ValidatePWPolicy
|
||||
|
||||
main = do
|
||||
@@ -37,10 +37,10 @@ main = do
|
||||
exitFailure
|
||||
|
||||
tests = TestList
|
||||
[ PWPolicy.tests
|
||||
[ NewPWData.tests
|
||||
, NewPWPolicy.tests
|
||||
, NewPWSalt.tests
|
||||
, ValidatePWPolicy.tests
|
||||
, NewSalt.tests
|
||||
, NewPWData.tests
|
||||
]
|
||||
|
||||
--jl
|
||||
|
||||
@@ -35,7 +35,7 @@ tests = TestLabel "newPData" $ TestList
|
||||
|
||||
testSalt x = TestLabel "pwSalt" $
|
||||
x^.pwSalt ~?= salt where
|
||||
(salt, _) = newSalt g
|
||||
(salt, _) = newPWSalt g
|
||||
|
||||
testPolicy x = TestLabel "pwPolicy" $
|
||||
x^.pwPolicy ~?= newPWPolicy
|
||||
|
||||
@@ -20,7 +20,7 @@ License along with this program. If not, see
|
||||
|
||||
-}
|
||||
|
||||
module Spec.PWPolicy (tests) where
|
||||
module Spec.NewPWPolicy (tests) where
|
||||
|
||||
import Control.Lens ((^.))
|
||||
import Test.HUnit (Test(..), (~?=))
|
||||
@@ -20,7 +20,7 @@ License along with this program. If not, see
|
||||
|
||||
-}
|
||||
|
||||
module Spec.NewSalt (tests) where
|
||||
module Spec.NewPWSalt (tests) where
|
||||
|
||||
import qualified Data.ByteString as B
|
||||
import System.Random (mkStdGen)
|
||||
@@ -28,12 +28,12 @@ import Test.HUnit (Test(..), assertBool, (~?=))
|
||||
|
||||
import Password
|
||||
|
||||
tests = TestLabel "newSalt" $ TestList
|
||||
tests = TestLabel "newPWSalt" $ TestList
|
||||
[ testLength salt
|
||||
, testDiff salt salt'
|
||||
] where
|
||||
(salt, g') = newSalt g
|
||||
(salt', _) = newSalt g'
|
||||
(salt, g') = newPWSalt g
|
||||
(salt', _) = newPWSalt g'
|
||||
g = mkStdGen 1
|
||||
|
||||
testLength x = TestLabel "salt length" $ B.length x ~?= 256
|
||||
Reference in New Issue
Block a user