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

Function TestValueInt

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

Source from the content-addressed store, hash-verified

215}
216
217func TestValueInt(t *testing.T) {
218 c, _ := e.NewContext()
219
220 for _, tt := range valueIntTests {
221 val, err := NewValue(tt.value)
222 if err != nil {
223 t.Errorf("NewValue('%v'): %s", tt.value, err)
224 continue
225 }
226
227 actual := val.Int()
228
229 if reflect.DeepEqual(actual, tt.expected) == false {
230 t.Errorf("Value.Int('%v'): expected '%#v', actual '%#v'", tt.value, tt.expected, actual)
231 }
232
233 val.Destroy()
234 }
235
236 c.Destroy()
237}
238
239var valueFloatTests = []struct {
240 value interface{}

Callers

nothing calls this directly

Calls 5

IntMethod · 0.95
DestroyMethod · 0.95
DestroyMethod · 0.95
NewValueFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected