test

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Overview

Package test provides testing utilities for the WGSL minifier.

This follows esbuild's testing patterns with helper functions for assertions, diffs, and common test patterns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual[T comparable](t *testing.T, actual, expected T)

AssertEqual checks if two values are equal and reports a test error if not.

func AssertEqualWithDiff

func AssertEqualWithDiff(t *testing.T, actual, expected string)

AssertEqualWithDiff checks if two strings are equal and shows a diff if not.

func Diff

func Diff(expected, actual string) string

Diff produces a line-by-line diff between two strings. Shows context around differences with +/- prefixes.

func MarkFailure

func MarkFailure(t *testing.T, format string, args ...interface{})

MarkFailure is a wrapper that marks a test as failed with a message.

Types

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

Suite provides a test context for related tests.

func NewSuite

func NewSuite(t *testing.T) *Suite

NewSuite creates a new test suite.

func (*Suite) Run

func (s *Suite) Run(name string, fn func(t *testing.T))

Run runs a subtest.

Jump to

Keyboard shortcuts

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