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

Function TestValueString

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

Source from the content-addressed store, hash-verified

392}
393
394func TestValueString(t *testing.T) {
395 c, _ := e.NewContext()
396
397 for _, tt := range valueStringTests {
398 val, err := NewValue(tt.value)
399 if err != nil {
400 t.Errorf("NewValue('%v'): %s", tt.value, err)
401 continue
402 }
403
404 actual := val.String()
405
406 if reflect.DeepEqual(actual, tt.expected) == false {
407 t.Errorf("Value.String('%v'): expected '%#v', actual '%#v'", tt.value, tt.expected, actual)
408 }
409
410 val.Destroy()
411 }
412
413 c.Destroy()
414}
415
416var valueSliceTests = []struct {
417 value interface{}

Callers

nothing calls this directly

Calls 5

StringMethod · 0.95
DestroyMethod · 0.95
DestroyMethod · 0.95
NewValueFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected