MCPcopy Create free account
hub / github.com/deuill/go-php / TestValueSlice

Function TestValueSlice

engine/value_test.go:453–473  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

451}
452
453func TestValueSlice(t *testing.T) {
454 c, _ := e.NewContext()
455
456 for _, tt := range valueSliceTests {
457 val, err := NewValue(tt.value)
458 if err != nil {
459 t.Errorf("NewValue('%v'): %s", tt.value, err)
460 continue
461 }
462
463 actual := val.Slice()
464
465 if reflect.DeepEqual(actual, tt.expected) == false {
466 t.Errorf("Value.Slice('%v'): expected '%#v', actual '%#v'", tt.value, tt.expected, actual)
467 }
468
469 val.Destroy()
470 }
471
472 c.Destroy()
473}
474
475var valueMapTests = []struct {
476 value interface{}

Callers

nothing calls this directly

Calls 5

SliceMethod · 0.95
DestroyMethod · 0.95
DestroyMethod · 0.95
NewValueFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected