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

Version Path
trackler-2.0.8.48 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.47 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.46 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.45 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.44 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.43 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.42 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.41 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.40 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.39 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.38 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.37 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.36 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.35 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.34 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.33 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.32 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.31 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.30 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.29 tracks/sml/exercises/accumulate/test_accumulate.sml