- Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsolution_test.go
38 lines (32 loc) · 668 Bytes
/
solution_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package leetcode
import (
"fmt"
"testing"
)
funcTestReverse(t*testing.T) {
varx, retint
x=123
ret=321
fmt.Printf("x = %v ret = %v\n", x, reverse(x))
ifreverse(x) !=ret {
t.Fatalf("case fails: %v\n", ret)
}
x=-123
ret=-321
fmt.Printf("x = %v ret = %v\n", x, reverse(x))
ifreverse(x) !=ret {
t.Fatalf("case fails: %v\n", ret)
}
x=120
ret=21
fmt.Printf("x = %v ret = %v\n", x, reverse(x))
ifreverse(x) !=ret {
t.Fatalf("case fails: %v\n", ret)
}
x=1<<31
ret=0
fmt.Printf("x = %v ret = %v\n", x, reverse(x))
ifreverse(x) !=ret {
t.Fatalf("case fails: %v\n", ret)
}
}