Open pablomarx opened 5 years ago
I've tested and this appears to be resolved by @pguyot's latest fixes. Thanks!
Indeed, this should be closed, and there is a new regression test. I'm sorry I didn't phrase the commit message in a way to get GitHub to close the issue automatically.
The one thing I didn't pay attention to in my initial testing is that CurrentException().message
isn't working, but maybe that's a separate issue.
Didn't realize you wrote a unit test library in 2012. I wrote a quick and dirty imitation to add unit tests to NEWT/0.
@morgant @gnue : What do you think about merging NSUnit into NEWT/0?
Also, did you try running your library in NTK? I'm in the process of getting NEWT/0 to generate code compatible with the Newton (and therefore similar to or equal to what NTK generates), and did run my NEWT/0 tests in NTK. It required few modifications.
Regarding CurrentException().message
, the bug was a typo which I fixed in #18
@pguyot Thanks for yet another fix!
I have to admit that NSUnit is pretty rudimentary and doesn't have all that many assertions. I was just using it to learn NewtonScript and was doing so solely with NEWT/0 (it did lead me to add Perform()
support to NEWT/0), so never tested with NTK. At the time, I was running into what I thought were issues in my Perform()
implementation and didn't realize that it was more about exceptions implementation. Only with your recent fixes do I see that NSUnit is working.
I'm certainly open to merging NSUnit into NEWT/0, if you and @gnue feel it actually makes sense.
The following NewtonScript code demonstrates the problem:
When ran under NEWT/0, the output is:
Note: No exception was caught during Perform(x, 'test, [])
Under WallyScript/NewtonScript 1.x: