nimtest

Simple testing framework for Nim

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License GPL-2.0-only
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Installation

nimble install nimtest
choosenim install nimtest
git clone https://github.com/avahe-kellenberger/nimtest

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
nimtest - - - - - - -

Source

Repository https://github.com/avahe-kellenberger/nimtest
Homepage https://github.com/avahe-kellenberger/nimtest
Registry Source nimble_official

README

nimtest

A simple testing framework for Nim.

This is used mostly for my personal projects. If you're looking for something more "official", take a look at Testament.

Examples

See the tests directory for more comprehensive tests.

describe "assertEquals":

  type Foo = ref object
    x: int

  it "works properly with nillable objects":
    var f: Foo = nil
    assertEquals(f, nil)

    f = Foo(x: 5)
    assertRaises:
      assertEquals(f, nil)

describe "Test with hooks":
  var
    lock: Lock
    a: int

  beforeAll:
    initLock(lock)

  beforeEach:
    a = 5
    acquire(lock)

  afterEach:
    release(lock)

  afterAll:
    deinitLock(lock)

  it "tests something":
    doAssert(a == 5)