assert
Package assert provides assertion utilities for testing Starlark programs.
load("assert", ...)
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.
load("assert", "assert")
Functions
catch_error(fn: Callable)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
fn | Callable | ✓ |
Returns: String
matches(pattern: String, str: String)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
pattern | String | ✓ | |
str | String | ✓ |
Returns: Bool
error(x: String)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
x | String | ✓ |
Returns: None