1 definition module testable
4 GAST: A Generic Automatic Software Test-system
6 testable: the test algorithm for logical properties
8 Pieter Koopman, 2002-2010
9 Radboud Universty, Nijmegen
15 from stdProperty import ::Property // for instance of testable
20 :: Admin = {labels::![String], args::![String], name::![String], res::Result}
21 :: Result = Undef | Rej | Pass | OK | CE
22 :: RandomStream :== [Int]
27 :: Property = Prop (RandomStream Admin -> [Admin])
29 prop :: a -> Property | Testable a
31 class TestArg a | genShow{|*|}, ggen{|*|} a
32 class Testable a where evaluate :: a RandomStream !Admin -> [Admin]
34 instance Testable Bool
35 instance Testable Result
36 instance Testable Property
37 instance Testable (a->b) | Testable b & TestArg a
38 instance Testable [a] | Testable a
40 //derive bimap [], (,), (,,), (,,,), (,,,,), (,,,,,)
45 //--- for generating lists of elements ---//
47 aStream :: RandomStream
49 //--- for implementation of properties ---//
51 diagonal :: [[a]] -> [a]
52 forAll :: !(a->b) ![a] RandomStream !Admin -> [Admin] | Testable b & TestArg a
53 split :: !RandomStream -> (RandomStream,RandomStream)
54 generateAll :: !RandomStream -> [a] | ggen{|*|} a
68 Test :: [Testoption] !p -> [String] | Testable p
69 TestList :: [Testoption] ![p] -> [String] | Testable p
71 verbose :: !RandomStream !p -> [String] | Testable p
72 verbosen :: !Int !RandomStream !p -> [String] | Testable p
73 concise :: !RandomStream !p -> [String] | Testable p
74 concisen :: !Int !RandomStream !p -> [String] | Testable p
75 quiet :: !RandomStream !p -> [String] | Testable p
76 quietn :: !Int !RandomStream !p -> [String] | Testable p
77 quietnm :: !Int !Int !RandomStream !p -> [String] | Testable p
79 test :: !p -> [String] | Testable p // test p NrOfTest times
80 testn :: !Int !p -> [String] | Testable p // maxnumber of tests
81 ttestn :: !Int !p -> [String] | Testable p // maxnumber of tests, trace all arguments
82 testnm :: !Int !Int !p -> [String] | Testable p // maxnumber of tests, max number of errors
83 ttestnm :: !Int !Int !p -> [String] | Testable p // maxnumber of tests, max number of errors