A test block
You will learn
How a test block is written and what a failing assert reports.
A test block starts with the keyword test and a name, and holds assert lines in braces. Each assert takes an expression that must be true. When one is false, the report names the test and the number of the assert, for example assert #1 is false. A spec's tests are its claims about itself, which is why every course spec on this site carries some.
Try it
Break the test on purpose by changing DAYS, then read the failure line.

A t27 test block and the report it gives when it passes and when an assert is false. Lesson 10 of the t27 basics course.
specs/basics/10_a_test_block.t27
// SPDX-License-Identifier: Apache-2.0
; t27 basics, lesson 10: A test block.
; A test is a name and a list of asserts; each assert must be true.
module basics_10_a_test_block;
pub const DAYS : u16 = 365;
pub const WEEKS : u16 = 52;
test a_year_is_52_weeks_and_a_day {
assert WEEKS * 7 + 1 == DAYS;
}
All lessons
Module 1 · A spec file
What a .t27 file holds: a module line, prose lines and comments.
Module 2 · Values and types
Constants, the width of a whole number, and true, false and text.
Module 3 · Arrays, trits and expressions
Lists of values, the three values of a trit, and what operators compute.
Module 4 · Tests and functions
A test block, several small tests in one spec, and a function with typed inputs.
Module 5 · Inside a function
Names with let and var, choices with if and switch, and loops.
Module 6 · Visibility and your own types
What pub shares with other modules, and the structs and enums you declare.
Module 7 · Modules, rules and gen-ts
Reading another module, stating a rule that always holds, and a spec turned into TypeScript.
Module 8 · The compiler and tri
The backends t27c writes, the stages it reads a spec in, and the tri command.
Module 9 · Errors, a program, what next
Reading a compiler error, one small complete program, and the course to take next.