mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Minor style change
This commit is contained in:
@@ -26,27 +26,27 @@ TEST_count := 0
|
|||||||
TEST_fail := 0
|
TEST_fail := 0
|
||||||
|
|
||||||
when ODIN_TEST {
|
when ODIN_TEST {
|
||||||
expect :: testing.expect
|
expect :: testing.expect
|
||||||
log :: testing.log
|
log :: testing.log
|
||||||
} else {
|
} else {
|
||||||
expect :: proc(t: ^testing.T, condition: bool, message: string, loc := #caller_location) {
|
expect :: proc(t: ^testing.T, condition: bool, message: string, loc := #caller_location) {
|
||||||
fmt.printf("[%v] ", loc)
|
fmt.printf("[%v] ", loc)
|
||||||
TEST_count += 1
|
TEST_count += 1
|
||||||
if !condition {
|
if !condition {
|
||||||
TEST_fail += 1
|
TEST_fail += 1
|
||||||
fmt.println(message)
|
fmt.println(message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.println(" PASS")
|
fmt.println(" PASS")
|
||||||
}
|
}
|
||||||
log :: proc(t: ^testing.T, v: any, loc := #caller_location) {
|
log :: proc(t: ^testing.T, v: any, loc := #caller_location) {
|
||||||
fmt.printf("[%v] ", loc)
|
fmt.printf("[%v] ", loc)
|
||||||
fmt.printf("log: %v\n", v)
|
fmt.printf("log: %v\n", v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
w, _ := io.to_writer(os.stream_from_handle(os.stdout))
|
w := io.to_writer(os.stream_from_handle(os.stdout))
|
||||||
t := testing.T{w=w}
|
t := testing.T{w=w}
|
||||||
zlib_test(&t)
|
zlib_test(&t)
|
||||||
gzip_test(&t)
|
gzip_test(&t)
|
||||||
|
|||||||
Reference in New Issue
Block a user