trak verify
Executes native language test suites against your local exercise code, validates test assertions, and automatically marks completed modules in trak.json.
Command Overview
The verify command runs automated test harnesses directly on your system using your installed compilers and runtime toolchains. If all tests for an exercise pass, Trak updates trak.json to mark the module complete, updates your workspace progress percentage, renders the visual progress bar, and recommends your next module. For hands-on laboratory tracks (Docker, Kubernetes, AWS, PostgreSQL, Linux, Git), Trak informs you that these tracks are architectural environments without compilers and guides you to use 'trak done <module>' instead.
Smart Module Resolution (No Full Names Required)
Prefix & Fuzzy MatchingTyping or copying full folder names like 00-setup-toolchain-and-first-program is completely optional. Trak CLI automatically resolves module targets through 4 multi-tier matching rules:
Type unpadded numbers or numeric prefixes. Trak normalizes leading zeros and trailing hyphens.
Terminal tab-completion with relative paths and trailing slashes (.\ or /) is cleanly sanitized.
Type any distinct keyword or topic from the module name. Case-insensitive substring matching.
test), Trak stops execution safely, displays all matching module candidates in your terminal, and prompts you to specify.Supported Language Verification Runtimes
7 Automated TracksTrak automatically detects the required toolchains in your system PATH and executes native test harnesses with zero external configuration.
| Language | Track Pattern | Required Binary | Test Runner | Architecture Note |
|---|---|---|---|---|
| Go | lang/go | go | go test -v ./... | Native Go test runner testing all packages in current module. |
| Python | lang/python | python / python3 | unittest discover | Zero-dependency test discovery using standard library unittest module. |
| Rust | lang/rust | cargo | cargo test | Invokes cargo test using the module Cargo.toml manifest. |
| JavaScript | lang/javascript (lang/js) | node / bun | node --test | Built-in Node.js native test runner (Node 18+ / 20+), zero npm install needed. |
| TypeScript | lang/typescript (lang/ts) | node / bun | node --test | Native Node.js test runner with built-in TypeScript execution support. |
| C | lang/c | gcc / clang | gcc / clang | Compiles test harness and implementation using -Wall -Wextra -std=c11 -lm. |
| C++ | lang/cpp | g++ / clang++ | g++ / clang++ | Compiles test harness and implementation using -Wall -Wextra -std=c++17. |
Subcommands
trak verify allowlistsAliases: allowlist, list, supported, runtimesDisplays a tabular matrix of all 7 supported programming language tracks, their native test runner commands, and checks your system PATH to report whether each compiler or interpreter is installed and ready.
Execution Lifecycle
Available Flags
Verify all modules sequentially across the workspace and display full summary.
Show detailed compiler and test assertion output when tests fail.
List all 7 supported language verification runtimes and local toolchain readiness.
Show verify command synopsis, aliases, and usage examples.
Usage Examples
Automatically detects and verifies the first incomplete module in your curriculum.
Verifies Module 00 using numeric prefix matching.
Matches and runs tests for Module 02 automatically.
Matches Module 00 using prefix notation with trailing hyphen.
Trak automatically cleans trailing slashes, backslashes, and relative dots from shell autocompletion.
Matches module containing the keyword 'toolchain' in its directory name.
Displays compiler errors and assertion failure output to diagnose test failures.
Runs tests on every module in the workspace sequentially and outputs pass/fail statistics.
Checks which language compilers and test runners are installed on your machine.
Important Technical Guidelines
You never need to copy or type full directory names. Trak resolves targets using multi-tier matching: '00', '00-', '1', relative paths with trailing slashes (.\00-setup*\), or keyword substrings ('toolchain', 'pointer', 'memory'). This same smart matching works across 'trak verify', 'trak done', and 'trak undo'.
Trak uses your local operating system toolchains rather than downloading massive bundled compilers. To verify Go exercises, install Go; for Rust, install Cargo; for JavaScript/TypeScript, install Node.js; for Python, install Python; and for C/C++, install GCC/Clang or MinGW. Run 'trak verify allowlists' to audit your machine.
All language test suites are authored using native built-in runners (node --test, standard python unittest, go test, cargo test, and native C/C++ assertion runners). Learners never need to run 'npm install' or configure third-party test frameworks to complete exercises.
Automated test verification is designed for programming language tracks (lang/go, lang/rust, lang/python, lang/javascript, lang/typescript, lang/c, lang/cpp). Architectural tracks (tool/docker, db/postgres, cloud/aws, os/linux) are practical environments without compiler test suites; use 'trak done <module>' to mark these completed after following their README instructions.
When a test succeeds, Trak immediately writes the completed status to trak.json with 2-space indentation. You do not need to manually run 'trak done' on verified code.