Open Night-walker opened 9 years ago
Nice, this could also be more user friendly for testing applications.
Also, line number detection for unexpectedly raised errors is highly desirable. Currently this information is unavailable.
Also, line number detection for unexpectedly raised errors is highly desirable. Currently this information is unavailable.
Somewhat related to https://github.com/daokoder/dao/issues/298 .
Also, line number detection for unexpectedly raised errors is highly desirable. Currently this information is unavailable.
Now it is made available.
BTW, I prefer we rename this module, something like testing
, or unitest
, or unittest
. The reason is that test
is such a common name that, when one wants to write something for testing, very likely it will be named as test.dao
.
Right, testing
would be fine.
Exception::.line()
does not give correct line number. For instance, the example above reports error at line 3 if the new method is utilized.
Now there is a problem with the decorator. When I do DaoProcess_Call()
on a 'decoratee' of @test
(the latter is passed manually to runTests()
), it looks like @test
itself does not run -- error in a failing test is not caught.
While
daotest
is suitable for testing the DaoVM (e.g., it is able to properly test parsing and typing mechanics), I felt the need to have an assertion-based test framework I could use for standard modules. So here it is.Simple example:
Output:
Currently,
test.runTest()
just dumbly runs all global routines matching prefix. Would be nice if it was possible to sort it out by picking only@test
-decorated routines (this issue).