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

Function TestValueFloat

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

Source from the content-addressed store, hash-verified

274}
275
276func TestValueFloat(t *testing.T) {
277 c, _ := e.NewContext()
278
279 for _, tt := range valueFloatTests {
280 val, err := NewValue(tt.value)
281 if err != nil {
282 t.Errorf("NewValue('%v'): %s", tt.value, err)
283 continue
284 }
285
286 actual := val.Float()
287
288 if reflect.DeepEqual(actual, tt.expected) == false {
289 t.Errorf("Value.Float('%v'): expected '%#v', actual '%#v'", tt.value, tt.expected, actual)
290 }
291
292 val.Destroy()
293 }
294
295 c.Destroy()
296}
297
298var valueBoolTests = []struct {
299 value interface{}

Callers

nothing calls this directly

Calls 5

FloatMethod · 0.95
DestroyMethod · 0.95
DestroyMethod · 0.95
NewValueFunction · 0.85
NewContextMethod · 0.80

Tested by

no test coverage detected