nim-testing

Run deterministic Nim test suites across debug, release, and danger compiler modes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/planetis-m/skills_experiment --skill nim-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nim-testing
Source: https://github.com/planetis-m/skills_experiment/tree/main/skills/nim-testing
Command: npx skills add https://github.com/planetis-m/skills_experiment --skill nim-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you reliably verify Nim behavior with deterministic tests that catch both assertion failures and unsafe memory issues before they ship.

Core Features & Use Cases

  • Deterministic Nim test patterns: Use block scopes with doAssert and doAssertRaises for predictable pass/fail outcomes.
  • Consistent project test layout + runner: Provide an auto-discovering tests/tester.nim that compiles and runs all tests/t*.nim files.
  • Multi-configuration execution: Run the same suite in debug, release, and danger modes to surface configuration-specific issues.
  • Optional AddressSanitizer integration: Enable ASan via compiler and linker flags to detect invalid memory access.

Quick Start

Run the test runner from your project root with nim c -r tests/tester.nim.

Frequently Asked Questions about nim-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run deterministic unit tests in Nim across different compiler modes?

Run the auto-discovering tests/tester.nim runner via `nim c -r tests/tester.nim` to execute deterministic Nim unit tests using doAssert and doAssertRaises across debug, release, and danger compiler configurations.

How does AddressSanitizer integration work with Nim test suites?

AddressSanitizer integration applies ASan build flags containing both C and linker sanitizer parameters to Nim test executions, detecting invalid memory access and unsafe memory issues during the test runner execution.

What is the best way to check for expected assertion failures in Nim?

Use std/assertions with doAssertRaises within block scopes to validate expected exception behavior. This deterministic testing pattern ensures predictable pass/fail outcomes when verifying failure behavior in Nim projects.

Can I use this test runner to validate failure behavior and unsafe memory access?

Yes, the test runner validates failure behavior using expected-exception checks via doAssertRaises, and detects unsafe memory access by enabling optional AddressSanitizer build flags with C and linker sanitizer parameters.

Why should I run Nim tests in debug, release, and danger configurations?

Running Nim tests in debug, release, and danger configurations surfaces configuration-specific issues by executing the same deterministic test suite across multiple compiler modes, catching assertion failures and unsafe memory problems before shipping.