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

Function TestValueBool

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

Source from the content-addressed store, hash-verified

333}
334
335func TestValueBool(t *testing.T) {
336 c, _ := e.NewContext()
337
338 for _, tt := range valueBoolTests {
339 val, err := NewValue(tt.value)
340 if err != nil {
341 t.Errorf("NewValue('%v'): %s", tt.value, err)
342 continue
343 }
344
345 actual := val.Bool()
346
347 if reflect.DeepEqual(actual, tt.expected) == false {
348 t.Errorf("Value.Bool('%v'): expected '%#v', actual '%#v'", tt.value, tt.expected, actual)
349 }
350
351 val.Destroy()
352 }
353
354 c.Destroy()
355}
356
357var valueStringTests = []struct {
358 value interface{}

Callers

nothing calls this directly

Calls 5

BoolMethod · 0.95
DestroyMethod · 0.95
DestroyMethod · 0.95
NewValueFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected