Skip to main content

assert

Package assert provides assertion utilities for testing Starlark programs.

assert

Package assertmodule defines utilities for testing Starlark programs. Clients can call LoadAssertModule to load a module that defines several functions useful for testing. See assert.star for its definition. The assert.error function, which reports errors to the current Go testing.T, requires that clients call SetReporter(thread, t) before use.

Functions

catch_error(fn: Callable)

Parameters:

NameTypeRequiredDescription
fnCallable

Returns: String


matches(pattern: String, str: String)

Parameters:

NameTypeRequiredDescription
patternString
strString

Returns: Bool


error(x: String)

Parameters:

NameTypeRequiredDescription
xString

Returns: None