Table of contents
Getting Started
Installation
Usage
FAQ
Testing
What's new
Migration Guide
Basic Syntax
Data Types
Expressions
Variables
Conditions
Commands
Arrays
Loops
Functions
Importing
Advanced Syntax
As Cast
Builtins
Type Condition
Compiler Flags
Standard Library
Array
Date
Environment
FileSystem
HTTP
Math
Test
Text
Contributing
How to
Guide
Compiler structure
Amber by Example
Backup Rotator
ShellCheck tester
Ubuntu Updater
Bot Detector
LSP Installer
Press
Test
assert
pub fun assert(condition: Bool)
Asserts that a boolean condition is true. Fails the test with exit code 1 if false.
Usage
import { assert } from "std/test"
let user_age = 18
assert(user_age >= 18)
assert_eq
pub fun assert_eq(left, right)
Asserts that two values are equal. Fails the test with exit code 1 if they are not equal.
Usage
import { assert_eq } from "std/test"
let expected = [1, 2, 3]
let actual = [1, 2, 3]
assert_eq(expected, actual)
Table of contents
Getting Started
Installation
Usage
FAQ
Testing
What's new
Migration Guide
Basic Syntax
Data Types
Expressions
Variables
Conditions
Commands
Arrays
Loops
Functions
Importing
Advanced Syntax
As Cast
Builtins
Type Condition
Compiler Flags
Standard Library
Array
Date
Environment
FileSystem
HTTP
Math
Test
Text
Contributing
How to
Guide
Compiler structure
Amber by Example
Backup Rotator
ShellCheck tester
Ubuntu Updater
Bot Detector
LSP Installer
Press