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).

Home Page:https://nim-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maybe clean tests

ringabout opened this issue · comments

git diff --color-moved --color-moved-ws=ignore-all-space cbc793b^..cbc793b | grep '\binclude\b'

+include parsecsv
+include stats
+include uri

=> use similar technique to transform those into import

  • another thing would be a giant s/assert/doAssert/ under tests/ ; curious which cases would need to stay as assert, besides maybe a test that actually tests for assert (eg in tests/assert/tassert.nim or such)
    (refs: timotheecour#64 (comment))
  • clean unittest style

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