Revision 01e52493 htest/Test/Ganeti/HTools/CLI.hs
b/htest/Test/Ganeti/HTools/CLI.hs | ||
---|---|---|
39 | 39 |
import Test.Ganeti.TestCommon |
40 | 40 |
import Test.Ganeti.Common |
41 | 41 |
|
42 |
import Ganeti.BasicTypes |
|
42 | 43 |
import Ganeti.HTools.CLI as CLI |
43 | 44 |
import qualified Ganeti.HTools.Program as Program |
44 | 45 |
import qualified Ganeti.HTools.Types as Types |
... | ... | |
49 | 50 |
prop_parseISpec :: String -> Int -> Int -> Int -> Property |
50 | 51 |
prop_parseISpec descr dsk mem cpu = |
51 | 52 |
let str = printf "%d,%d,%d" dsk mem cpu::String |
52 |
in parseISpecString descr str ==? Types.Ok (Types.RSpec cpu mem dsk)
|
|
53 |
in parseISpecString descr str ==? Ok (Types.RSpec cpu mem dsk) |
|
53 | 54 |
|
54 | 55 |
-- | Test parsing failure due to wrong section count. |
55 | 56 |
prop_parseISpecFail :: String -> Property |
... | ... | |
58 | 59 |
forAll (replicateM nelems arbitrary) $ \values -> |
59 | 60 |
let str = intercalate "," $ map show (values::[Int]) |
60 | 61 |
in case parseISpecString descr str of |
61 |
Types.Ok v -> failTest $ "Expected failure, got " ++ show v
|
|
62 |
Ok v -> failTest $ "Expected failure, got " ++ show v |
|
62 | 63 |
_ -> passTest |
63 | 64 |
|
64 | 65 |
-- | Test a few string arguments. |
Also available in: Unified diff