I would like to profit from the utest.Assert
methods. Currently I just want to write very small lightweight tests, however it seems using Assert
is not intended that way? Maybe only works inside a TestCase
and that must “extend utest.Test
or implement utest.ITest
.” (from the README.md
file). Anyway here’s some sample:
import utest.*;
class MyClass {
public static function main() {
trace("start");
Assert.equals( true, true );
trace("ending...");
}
}
-lib utest
-main MyClass
-hl test.hl
…
But from that I get (using HashLink):
MyClass.hx:5: start
Uncaught exception: Assert at MyClass.hx:6 out of context. Most likely you are trying to assert after a test timeout.
Called from utest.$Assert.equals(utest/Assert.hx:141)
Called from $MyClass.main(MyClass.hx:6)
Called from fun$470(?:1)
…
Is there a way to just profit from the utest.Assert
alone without the whole utest setup stuff? I mean the class Assert
says “used to perform assertations inside a test method.” (github) Maybe that refers to TestCase only, irdk…
Thank you.