strange behaviour of eutest
- Posted by axtens_bruce in February
- 396 views
include std/unittest.e include leap.ex set_test_verbosity(TEST_SHOW_ALL) integer id = routine_id("leap") assert("routine_id", id = -1) test_false("year not divisible by 4 in common year" , leap(1800)) test_false("year divisible by 100 but not by 3 is still not a leap year" , leap(1900)) test_false("year divisible by 2, not divisible by 4 in common year" , leap(1970)) test_false("year divisible by 200, not divisible by 400 in common year" , leap(2015)) test_false("year divisible by 100, not divisible by 400 in common year" , leap(2100)) test_true("year divisible by 4 and 5 is still a leap year" , leap(1960)) test_true("year divisible by 4, not divisible by 100 in leap year" , leap(1996)) test_true("year divisible by 400 is leap year" , leap(2000)) test_true("year divisible by 400 but not by 125 is still a leap year" , leap(2400)) test_report()
When leap.ex is empty, this causes the assert to fail. The output it curious:
failed: routine_id, expected: TRUE but got: FALSE /usr/local/euphoria-4.1.0-Linux-x64/include/std/unittest.e:454 in procedure assert() routine_id ... called from /tmp/t_leap.e:8 --> See ex.err failed: unittesting crashed, expected: TRUE but got: FALSE 2 tests run, 0 passed, 2 failed, 0% success interpreting /tmp/t_leap.e: FAILURE: /tmp/t_leap.e EUPHORIA error with status 1 Test results summary: FAIL: /tmp/t_leap.e Files (run: 1) (failed: 1) (0% success)If the assert is one test, what's the other?
-Bruce
LATER
Would it be better to extend the bounds of the if?