-
Notifications
You must be signed in to change notification settings - Fork 0
/
arguments_test.go
66 lines (56 loc) · 1.35 KB
/
arguments_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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package mazzaroth
import "testing"
func TestStringBool(t *testing.T) {
p := Bool(false)
if p != "false" {
t.Fatalf("string %s does not match string %s", p, "false")
}
}
func TestStringInt32(t *testing.T) {
p := Int32(1)
if p != "1" {
t.Fatalf("string %s does not match string %s", p, "1")
}
}
func TestStringInt64(t *testing.T) {
p := Int64(1)
if p != "1" {
t.Fatalf("string %s does not match string %s", p, "1")
}
}
func TestStringUint32(t *testing.T) {
p := Uint32(1)
if p != "1" {
t.Fatalf("string %s does not match string %s", p, "1")
}
}
func TestStringUint64(t *testing.T) {
p := Uint64(1)
if p != "1" {
t.Fatalf("string %s does not match string %s", p, "1")
}
}
func TestStringFloat64(t *testing.T) {
p := Float64(3.14159265)
if p != "3.14159265e+00" {
t.Fatalf("string %s does not match string %s", p, "3.14159265e+00")
}
}
func TestStringString(t *testing.T) {
p := String("test")
if p != "test" {
t.Fatalf("string %s does not match string %s", p, "test")
}
}
func TestStringByte(t *testing.T) {
p := Bytes([]byte("test"))
if p != "test" {
t.Fatalf("string %s does not match string %s", p, "test")
}
}
func TestStringJson(t *testing.T) {
p := JsonBytes([]byte(`{"test": "hello"}`))
if p != "\"{\\\"test\\\": \\\"hello\\\"}\"" {
t.Fatalf("string %s does not match string %s", p, "\"{\\\"test\\\": \\\"hello\\\"}\"")
}
}