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.
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
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}"
Thanks. This is one of the options I was considering.
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,
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 ...
Great, that worked! Thank you very much indeed. I will try asking on IRC next
time something like this comes up.
OK, thanks very much. I will switch to trying object variants.
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.
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
10 matches
Mail list logo