Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v0.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

@test extension

The test bundle adds @test as a post-run assertion for .nflow acceptance flows. It accepts the same single-expression, multiline-block, and compact-list forms as @assert and records checks for the existing runner assertion machinery.

const @{ value: "ready" }
@test: result == "ready"

The shipped CLI mounts this extension only while nflow test executes each entrypoint. The bundle is deliberately absent from native.Bundles and is not registered with the process-wide @require registry. Normal nflow run, lint, and other commands therefore do not recognize @test. Existing @assert behavior is unchanged.

Documentation

Overview

Package test provides an opt-in @test directive for nflow test runs.

The bundle is intentionally not registered in the process-wide compiler registry or added to native.Bundles. Hosts mount it only when test behavior is explicitly enabled.

Index

Constants

View Source
const ID = "test"

Variables

View Source
var Directive = compiler.Directive{
	Name:        "test",
	Example:     "@test: result.ok == true\n@test {\n  result.count > 0\n}",
	Handler:     handleDirective,
	OpaqueBlock: true,
}

Directive records a post-run assertion using the same syntax and metadata as @assert. Its availability is controlled by the host that mounts Bundle.

Functions

func Bundle

func Bundle(_ map[string]string) compiler.Bundle

Bundle returns the explicit, test-mode-only directive bundle. It is not registered automatically so normal nflow run invocations cannot see @test.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL