25 lines
617 B
Text
25 lines
617 B
Text
|
|
NAMESPACE := ""
|
|
|
|
func namespace(name: string, test: func()) {
|
|
NAMESPACE = name
|
|
test()
|
|
}
|
|
|
|
func assertEqual(a: any, b: any) {
|
|
if a != b {
|
|
write(format("assertion error: % should (but doesn't) equal %", [a, b]))
|
|
exit(1)
|
|
} else if env("DEBUG") != "" {
|
|
write(format("assertion success: % equals %", [a, b]))
|
|
}
|
|
}
|
|
|
|
func assertNotEqual(a: any, b: any) {
|
|
if a == b {
|
|
write(format("assertion error: % shouldn't (but does) equal %", [a, b]))
|
|
exit(1)
|
|
} else if env("DEBUG") != "" {
|
|
write(format("assertion success: % doesn't equal %", [a, b]))
|
|
}
|
|
}
|