Created
April 28, 2012 05:02
-
-
Save bleis-tift/2516188 to your computer and use it in GitHub Desktop.
SML#用の小さいテスティングフレームワーク
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datatype 'a result = | |
Pass | |
| Failure of { Actual: 'a, Expected: 'a } | |
; | |
fun test [] = [] | |
| test (x::xs) = | |
let | |
val actual = (#Target x)() | |
val expected = #Expected x | |
fun test' x = | |
if actual = expected then { Name = #Name x, Result = Pass } | |
else { Name = #Name x, Result = Failure { Actual = actual, Expected = expected } } | |
in | |
test' x :: (test xs) | |
end | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment