@@ -9,14 +9,14 @@ import (
9
9
"testing"
10
10
)
11
11
12
- func TestSyscallJsNull (t * testing.T ) {
12
+ func TestSyscallJSNull (t * testing.T ) {
13
13
want := "null"
14
14
if got := js .Null ().String (); got != want {
15
15
t .Errorf ("got %#v, want %#v" , got , want )
16
16
}
17
17
}
18
18
19
- func TestSyscallJsFuncOf (t * testing.T ) {
19
+ func TestSyscallJSFuncOf (t * testing.T ) {
20
20
c := js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
21
21
return args [0 ].Int () + args [1 ].Int ()
22
22
})
@@ -29,7 +29,7 @@ func TestSyscallJsFuncOf(t *testing.T) {
29
29
}
30
30
}
31
31
32
- func TestSyscallJsFuncOfObject (t * testing.T ) {
32
+ func TestSyscallJSFuncOfObject (t * testing.T ) {
33
33
c := js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
34
34
return args [0 ].Get ("foo" ).String ()
35
35
})
@@ -42,7 +42,7 @@ func TestSyscallJsFuncOfObject(t *testing.T) {
42
42
}
43
43
}
44
44
45
- func TestSyscallJsString (t * testing.T ) {
45
+ func TestSyscallJSString (t * testing.T ) {
46
46
obj := js .Global ().Call ("eval" , "'Hello'" )
47
47
got := obj .String ()
48
48
if want := "Hello" ; got != want {
@@ -56,7 +56,7 @@ func TestSyscallJsString(t *testing.T) {
56
56
}
57
57
}
58
58
59
- func TestSyscallJsInt64 (t * testing.T ) {
59
+ func TestSyscallJSInt64 (t * testing.T ) {
60
60
var i int64 = math .MaxInt64
61
61
got := js .ValueOf (i ).String ()
62
62
// js.Value keeps the value only in 53-bit precision.
@@ -65,7 +65,7 @@ func TestSyscallJsInt64(t *testing.T) {
65
65
}
66
66
}
67
67
68
- func TestSyscallJsInstanceOf (t * testing.T ) {
68
+ func TestSyscallJSInstanceOf (t * testing.T ) {
69
69
arr := js .Global ().Call ("eval" , "[]" )
70
70
got := arr .InstanceOf (js .Global ().Call ("eval" , "Array" ))
71
71
want := true
@@ -105,7 +105,7 @@ func TestSyscallJsInstanceOf(t *testing.T) {
105
105
}
106
106
}
107
107
108
- func TestSyscallJsTypedArrayOf (t * testing.T ) {
108
+ func TestSyscallJSTypedArrayOf (t * testing.T ) {
109
109
testTypedArrayOf (t , "[]int8" , []int8 {0 , - 42 , 0 }, - 42 )
110
110
testTypedArrayOf (t , "[]int16" , []int16 {0 , - 42 , 0 }, - 42 )
111
111
testTypedArrayOf (t , "[]int32" , []int32 {0 , - 42 , 0 }, - 42 )
@@ -135,7 +135,7 @@ func testTypedArrayOf(t *testing.T, name string, slice interface{}, want float64
135
135
})
136
136
}
137
137
138
- func TestSyscallJsType (t * testing.T ) {
138
+ func TestSyscallJSType (t * testing.T ) {
139
139
if got , want := js .Undefined ().Type (), js .TypeUndefined ; got != want {
140
140
t .Errorf ("got %s, want %s" , got , want )
141
141
}
@@ -162,7 +162,7 @@ func TestSyscallJsType(t *testing.T) {
162
162
}
163
163
}
164
164
165
- func TestSyscallJsValueOf (t * testing.T ) {
165
+ func TestSyscallJSValueOf (t * testing.T ) {
166
166
JSON := js .Global ().Get ("JSON" )
167
167
for _ , test := range []struct {
168
168
in interface {}
@@ -218,7 +218,7 @@ func TestSyscallJsValueOf(t *testing.T) {
218
218
}
219
219
}
220
220
221
- func TestSyscallJsFuncObject (t * testing.T ) {
221
+ func TestSyscallJSFuncObject (t * testing.T ) {
222
222
got := ""
223
223
f := js .FuncOf (func (this js.Value , args []js.Value ) interface {} {
224
224
got = args [0 ].Get ("foo" ).String () + this .Get ("name" ).String ()
@@ -238,7 +238,7 @@ func TestSyscallJsFuncObject(t *testing.T) {
238
238
}
239
239
}
240
240
241
- func TestSyscallJsValueOfFunc (t * testing.T ) {
241
+ func TestSyscallJSValueOfFunc (t * testing.T ) {
242
242
f := js .FuncOf (func (this js.Value , args []js.Value ) interface {} { return nil })
243
243
got := js .ValueOf (f ).Type ()
244
244
want := js .TypeFunction
@@ -247,7 +247,7 @@ func TestSyscallJsValueOfFunc(t *testing.T) {
247
247
}
248
248
}
249
249
250
- func TestSyscallJsTruthy (t * testing.T ) {
250
+ func TestSyscallJSTruthy (t * testing.T ) {
251
251
for _ , test := range []struct {
252
252
in interface {}
253
253
want bool
0 commit comments