After upgrading to Nim 1.6.12, my tests generate a lot of warnings - how to address?

2023-04-30 Thread vsajip
It turns out that the warnings don't appear when I run the tests (having made no changes to my code) using > $ testament p "tests/test?.nim" I'm not sure if that's because Testament just swallows console output from a lower-level test runner, or because it runs the tests with that pragma.

After upgrading to Nim 1.6.12, my tests generate a lot of warnings - how to address?

2023-04-26 Thread vsajip
I just upgraded to Nim 1.6.12 after a time away from working with Nim and one of my projects now gives lots of warnings when I run the project's tests (which all pass). The warnings are all of the form > ~/.choosenim/toolchains/nim-1.6.12/lib/pure/unittest.nim(552, 5) Warning: The > bare except

Printing a typedesc - compilation errors

2021-11-03 Thread vsajip
The following program: import strformat type Thingy = ref object of RootObj f: int proc newThingy(f: int): Thingy = new(result) result.f = f var t = newThingy(0) echo $t.type # prints "Thingy" echo &"t contains {t.f}"

Trying to unify an object model

2021-10-30 Thread vsajip
Thanks. This is one of the options I was considering.

Trying to unify an object model

2021-10-29 Thread vsajip
I'm working on a parsing application and I have to deal with both terminal and non-terminal nodes in the model. The terminal nodes (tokens) can have values of different types, expressed as an object variant: type TokenKind = enum IntegerNumber, FloatNumber,

How do you get the actual exception from doAssertRaises?

2021-10-25 Thread vsajip
In my tests I want to test that exceptions are correctly raised at certain points - but how do you get access to the raised exception object so that you can e.g. make assertions about its message / any other attributes? My Google-fu seems to be coming up short ...

Debugging a SIGSEGV

2021-10-20 Thread vsajip
Great, that worked! Thank you very much indeed. I will try asking on IRC next time something like this comes up.

Debugging a SIGSEGV

2021-10-20 Thread vsajip
OK, thanks very much. I will switch to trying object variants.

Debugging a SIGSEGV

2021-10-20 Thread vsajip
Tried with all of the `--gc:` options other than `--gc:go`. Same results :-( Fails also with `--gc:none`, except that I get lots of `uses GC'ed memory [GcMem]` messages from e.g. `unittest`. A `SIGSEGV` in all cases.

Debugging a SIGSEGV

2021-10-20 Thread vsajip
I'm working on a [project](https://github.com/vsajip/nim-cfg-lib) (early days) which crashes with a `SIGSEGV` in tests. It's pure Nim (no calls into C or anything like that) and it crashes at a point where that bit of code has been executed dozens of times. It's basically a toke