Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing

Ordered by the pipeline, then libraries, then dev tooling and the CLI.

PackageWhat it tests
internal/lexerToken-by-token output for fixed inputs; trivia (comments, blank lines); error cases
internal/preprocinclude file splicing and path resolution; circular-include detection; trivia handling
internal/parserAST shape via Sprint; operator precedence; the resolver’s scope / slot pass with shadowing + undefined-variable errors; constant folding; parse error cases
internal/interpreterFull programs in-memory with stdout captured; value-semantics aliasing (eager deep copies) under -race; CallByName / CallByNameWith dispatch and RaiseError classification
internal/lib/crcCRC-32 / CRC-64 checksums over bytes; codec-table lookups and aliases
internal/lib/encodingtoText / fromText (hex, base64); charset encode / decode; isAscii and length introspection
internal/lib/fsWhole-file read / write / append; metadata (stat); directory ops; buffered File handles, against temp dirs
internal/lib/hashMD5 / SHA-1 / SHA-256 one-shot compute and streaming update / finalize
internal/lib/ioInstall registers printf / sprintf; format verbs and the modifier grammar; arity and format errors
internal/lib/listspush / pop / sort / reverse / slice / concat / range; non-mutating (value) semantics
internal/lib/mapskeys / values / has / delete / merge; insertion order; missing-key errors
internal/lib/metameta.VERSION matches version.Version; meta.BUILD matches the compiler tag
internal/lib/netTCP / UDP loopback round-trips and DNS lookups (build-tag gated; the TinyGo stub returns friendly errors)
internal/lib/osenv / args / flag helpers; external-process run / spawn / wait / poll / kill
internal/lib/regexRE2 matches / find / findAll / replace / split; positional + named captures; the pattern cache
internal/lib/taskspawn observation - wait / poll / discard / waitAll / waitAny - under -race
internal/lib/testingAssertion vocabulary (assert*) throwing Error{kind:"assertion"}; run / runWith failure classification into testing.Result; text / TAP / JUnit report rendering
internal/lib/timeConstructors / accessors / arithmetic round-trip; ISO weekday remapping; deterministic via a nowFunc package-var override
internal/lintThe L001-L010 checks; # lint-disable suppression; --checks / .jennifer-lint selection and unknown-ID rejection
internal/profileCollector aggregation (self / cumulative, hit counts); table, Chrome-trace, and pprof rendering (gzip + string-table checks)
cmd/jenniferGolden test that runs every examples/*.j and compares stdout to examples/expected/*.txt; REPL inputComplete helper; AST-JSON validity; formatter idempotence + behavior preservation; cross-file error reporting

internal/lib/convert, internal/lib/math, and internal/lib/strings have no dedicated _test.go; they are exercised end to end through the golden examples/*.j suite and the interpreter’s in-memory program tests. internal/version is generated code (version_gen.go), verified indirectly through internal/lib/meta.

Run everything with go test ./.... Concurrency-touching packages (internal/interpreter, internal/lib/task) should also run under go test -race ./....