MCPcopy Create free account
hub / github.com/dop251/goja / TestExportArrayToArrayMismatchedLengths

Function TestExportArrayToArrayMismatchedLengths

object_test.go:397–408  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

395}
396
397func TestExportArrayToArrayMismatchedLengths(t *testing.T) {
398 vm := New()
399 a := vm.NewArray(1, 2)
400 var a1 [3]int
401 err := vm.ExportTo(a, &a1)
402 if err == nil {
403 t.Fatal("expected error")
404 }
405 if msg := err.Error(); !strings.Contains(msg, "lengths mismatch") {
406 t.Fatalf("unexpected error: %v", err)
407 }
408}
409
410func TestExportIterableToArrayMismatchedLengths(t *testing.T) {
411 vm := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
NewArrayMethod · 0.80
ExportToMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…