Skip to content

Commit 1210b4c

Browse files
committed
improve logging in the the kernel tests
1 parent b8090e3 commit 1210b4c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

kernel_test.go

+14-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import (
1010
zmq "github.com/pebbe/zmq4"
1111
)
1212

13+
const (
14+
failure = "\u2717"
15+
success = "\u2713"
16+
)
17+
1318
func TestMain(m *testing.M) {
1419
os.Exit(runTest(m))
1520
}
@@ -34,19 +39,26 @@ func TestEvaluate(t *testing.T) {
3439
}{
3540
{"import \"fmt\"\na := 1\nfmt.Println(a)", "1\n"},
3641
{"a = 2\nfmt.Println(a)", "2\n"},
37-
{"func myFunc(x int) int {\nreturn x+1\n}\nfmt.Println(\"func defined\")", "func defined\n"},
42+
{"func myFunc(x int) int {\nreturn x+1\n}\nfmt.Println(\"func defined\")", "func dfined\n"},
3843
{"b := myFunc(1)\nfmt.Println(b)", "2\n"},
3944
}
4045

46+
t.Logf("Should be able to evaluate valid code in notebook cells.")
47+
4148
for k, tc := range cases {
4249

50+
// Give a progress report.
51+
t.Logf(" Evaluating code snippet %d/%d.", k+1, len(cases))
52+
4353
// Get the result.
4454
result := testEvaluate(t, tc.Input, k)
4555

4656
// Compare the result.
4757
if result != tc.Output {
48-
t.Fatalf("[test case %d]: result -> %s\n expected -> %s", k+1, result, tc.Output)
58+
t.Errorf("\t%s Test case produced unexpected results.", failure)
59+
continue
4960
}
61+
t.Logf("\t%s Should return the correct cell output.", success)
5062
}
5163
}
5264

0 commit comments

Comments
 (0)