test

package
v0.81.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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