Minor style change

This commit is contained in:
gingerBill
2021-10-02 14:05:26 +01:00
parent 2d2e3ed6a1
commit 1e7c60e171
+17 -17
View File
@@ -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)