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.1.0.12 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.11 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.10 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.9 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.8 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.7 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.6 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.5 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.4 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.3 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.2 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.1 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.1.0.0 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.55 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.54 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.53 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.52 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.51 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.50 tracks/sml/exercises/accumulate/test_accumulate.sml
trackler-2.0.8.49 tracks/sml/exercises/accumulate/test_accumulate.sml