lancelote / sml-test

Bare-bones Standard ML test runner
MIT License
1 stars 0 forks source link

Handle runtime exceptions #9

Closed lancelote closed 3 years ago

lancelote commented 3 years ago

Example implementation file

fun max1(xs : int list) =
  if null xs
  then NONE
  else
    let val tl_ans = max1(tl xs)
    in if isSome tl_ans andalso valOf tl_ans > hd xs
       then tl_ans
       else SOME (hd xs)
    end

... test file

val test3 = valOf(max1 []);

... result

uncaught exception Option
  raised at: smlnj/init/pre-perv.sml:25.28-25.34

sml-test reports nothing.