Sha256: dcf6965481764ff4788276a7e61cb5946a7faa4049a75b8175b1482f8619233a
Contents?: true
Size: 480 Bytes
Versions: 208
Compression:
Stored size: 480 Bytes
Contents
use "example.sml"; val test_cases = [ ( [], (fn x => x), [] ), ( [1,2,3], (fn x => x*x), [1,4,9] ), ( [1,2,3], (fn x => x*x*x), [1,8,27] ), ( [1,2,3], (fn x => x+1), [2,3,4] ), ( [1,2,3], (fn x => x-1), [0,1,2] ) ]; fun run_tests [] = [] | run_tests ((input,function,expected)::ts) = (accumulate input function = 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