25 lines
592 B
Text
25 lines
592 B
Text
|
|
NAMESPACE := ""
|
|
|
|
fn namespace(name: str, test: fn()) {
|
|
NAMESPACE = name
|
|
test()
|
|
}
|
|
|
|
fn eq<T>(a: T, b: T) {
|
|
if a != b {
|
|
println(format("assertion error: % should (but doesn't) equal %", [a, b]))
|
|
exit(1)
|
|
} else if env("DEBUG") != "" {
|
|
println(format("assertion success: % equals %", [a, b]))
|
|
}
|
|
}
|
|
|
|
fn neq<T>(a: T, b: T) {
|
|
if a == b {
|
|
println(format("assertion error: % shouldn't (but does) equal %", [a, b]))
|
|
exit(1)
|
|
} else if env("DEBUG") != "" {
|
|
println(format("assertion success: % doesn't equal %", [a, b]))
|
|
}
|
|
}
|