Sha256: 9b7e773af63b3253aac872980cf7639e8a1ed27c7a59a8c3f314af2503559996
Contents?: true
Size: 812 Bytes
Versions: 208
Compression:
Stored size: 812 Bytes
Contents
use "example.sml"; val test_cases = [ ( 0, [] ), ( 1, [Eggs] ), ( 2, [Peanuts] ), ( 4, [Shellfish] ), ( 8, [Strawberries] ), ( 16, [Tomatoes] ), ( 32, [Chocolate] ), ( 64, [Pollen] ), ( 128, [Cats] ), ( 256, [] ), (* compound test cases *) ( 3, [Eggs,Peanuts] ), ( 20, [Shellfish, Tomatoes] ), ( 192, [Pollen, Cats] ), ( 255, [Eggs, Peanuts, Shellfish, Strawberries, Tomatoes, Chocolate, Pollen, Cats] ) ]; fun run_tests [] = [] | run_tests ((input,expected)::ts) = (allergies input = expected) :: run_tests ts val allTestsPass = List.foldl (fn (x,y) => x andalso y) true (run_tests test_cases)
Version data entries
208 entries across 208 versions & 1 rubygems