lloyAlloy on GitHub
Tests
Docs

Tests

Inline tests that vanish from the ship artifact

Updated

A @test function runs under alloy test. The ship artifact blanks it line for line. The check artifact keeps it typed, so the editor still sees it.

Alloytests.aly
1@test
2function clamp_keeps_range()
3    $assert(math.clamp(5, 0, 1) == 1)
4end
Emitted Luausame line count
1local __alloy = require("@alloy")
2
3
4                                                         return nil
  • Line for line: the four source lines stay four lines, empty but for the runtime's require and the module's return, so every later line keeps its number.
  • The std has its own suite: 22 lest specs and 182 tests, over Result, Future, Array, HashMap, Set, BitSet, Queue, Heap, Iter, Scope, Symbol, Signal, dispatch, Attributes, the wire format, remotes, messages, and the helpers.