✓
Passing This code compiles and runs correctly.
Code
// Hello World - The Front Page Example
// This exact code appears on korulang.org
// If this test fails, the website shows broken code!
import std/io
const {
name: "World"
debug: true
count: 42[i32]
}
std/io:print.blk {
{% if debug %}[DEBUG] {% endif %}Hello, {{ name:s }}!
The answer is {{ count:d }}.
}
Actual
[DEBUG] Hello, World!
The answer is 42.
Expected output
✓ Zig✓ JavaScript[DEBUG] Hello, World!
The answer is 42.
Emitted JavaScript source
const name = "World";
const debug = true;
const count = 42;
const main_module = {
flow0() {
console.log((debug ? "[DEBUG] " : "") + "Hello, " + name + "!\nThe answer is " + count + ".");
},
};
main_module.flow0();
Flows
flow ~const click a branch to expand · @labels scroll to their anchor
const (source: name: "World"
debug: true
count: 42[i32])
flow ~print.blk click a branch to expand · @labels scroll to their anchor
print.blk (source: {% if debug %}[DEBUG] {% endif %}Hello, {{ name:s }}!
The answer is {{ count:d }}.)
Test Configuration
MUST_RUN