test Same
Outputs a report as to whether the unsure expression is the same as the expected result.
Example (REPL) usages:
>>> testSame(1 == 2, true, "intentional failure")
Test (intentional failure): expected=true, got=false
>>> testSame(1 + 1, 2)
Test: passed
>>> testSame({ x: Int -> x + 1 }(5), 6, "lambda")
Test (lambda): passed
Content copied to clipboard
Parameters
T
type of the expression and expected results
unsure
expression to evaluate
expected Result
expression considered correct
test Name
visual indication of which test was run