7
7
// To run these tests:
8
8
//
9
9
// - Install Node
10
- // - Add /path/to/go/misc /wasm to your $PATH (so that "go test" can find
10
+ // - Add /path/to/go/lib /wasm to your $PATH (so that "go test" can find
11
11
// "go_js_wasm_exec").
12
12
// - GOOS=js GOARCH=wasm go test
13
13
//
@@ -587,13 +587,13 @@ func TestGarbageCollection(t *testing.T) {
587
587
// Note: All JavaScript functions return a JavaScript array, which will cause
588
588
// one allocation to be created to track the Value.gcPtr for the Value finalizer.
589
589
var allocTests = []struct {
590
- argLen int // The number of arguments to use for the syscall
590
+ argLen int // The number of arguments to use for the syscall
591
591
expected int // The expected number of allocations
592
592
}{
593
593
// For less than or equal to 16 arguments, we expect 1 alloction:
594
594
// - makeValue new(ref)
595
- {0 , 1 },
596
- {2 , 1 },
595
+ {0 , 1 },
596
+ {2 , 1 },
597
597
{15 , 1 },
598
598
{16 , 1 },
599
599
// For greater than 16 arguments, we expect 3 alloction:
@@ -613,7 +613,7 @@ func TestCallAllocations(t *testing.T) {
613
613
tmpArray := js .Global ().Get ("Array" ).New (0 )
614
614
numAllocs := testing .AllocsPerRun (100 , func () {
615
615
tmpArray .Call ("concat" , args ... )
616
- });
616
+ })
617
617
618
618
if numAllocs != float64 (test .expected ) {
619
619
t .Errorf ("got numAllocs %#v, want %#v" , numAllocs , test .expected )
@@ -630,7 +630,7 @@ func TestInvokeAllocations(t *testing.T) {
630
630
concatFunc := tmpArray .Get ("concat" ).Call ("bind" , tmpArray )
631
631
numAllocs := testing .AllocsPerRun (100 , func () {
632
632
concatFunc .Invoke (args ... )
633
- });
633
+ })
634
634
635
635
if numAllocs != float64 (test .expected ) {
636
636
t .Errorf ("got numAllocs %#v, want %#v" , numAllocs , test .expected )
@@ -647,7 +647,7 @@ func TestNewAllocations(t *testing.T) {
647
647
648
648
numAllocs := testing .AllocsPerRun (100 , func () {
649
649
arrayConstructor .New (args ... )
650
- });
650
+ })
651
651
652
652
if numAllocs != float64 (test .expected ) {
653
653
t .Errorf ("got numAllocs %#v, want %#v" , numAllocs , test .expected )
0 commit comments