ringabout / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
1 stars 0 forks source link

Maybe clean tests #3

Open ringabout opened 4 years ago

ringabout commented 4 years ago

https://github.com/nim-lang/Nim/pull/16096#discussion_r530240265 https://github.com/nim-lang/Nim/pull/16101#discussion_r530604793

timotheecour commented 4 years ago

=> use similar technique to transform those into import

timotheecour commented 4 years ago
ringabout commented 3 years ago
timotheecour commented 3 years ago

clean unittest style

can you clarify what you mean? eg,

suite "Bacon":
  test ">:)":
    check(foo == bar)

I'd write it as:

block: # Bacon
  check foo == bar

(but not necessarily doAssert foo == bar)

which adhers to the principle of: "only print something if there's something wrong", unlike suite "Bacon": which outputs [suite] Bacon regardless if test pass/failed, and is more informative than doAssert foo == bar when test fails