MCPcopy Create free account
hub / github.com/araddon/qlbridge / TestString

Function TestString

value/value_test.go:297–307  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

295 assert.True(t, CloseEnuf(nv.Float(), float64(25.5)))
296}
297func TestString(t *testing.T) {
298 v := NewStringValue("a")
299 slv := v.StringsValue()
300 assert.Equal(t, 1, slv.Len())
301 assert.Equal(t, "a", slv.Val()[0])
302
303 v = NewStringValue("15.3")
304 assert.Equal(t, int64(15), v.IntValue().Val())
305 v = NewStringValue("15")
306 assert.Equal(t, int64(15), v.IntValue().Val())
307}
308func TestErrValue(t *testing.T) {
309 v := NewErrorValuef("%v", "damn")
310 assert.Equal(t, false, v.Nil())

Callers

nothing calls this directly

Calls 6

StringsValueMethod · 0.95
IntValueMethod · 0.95
NewStringValueFunction · 0.85
EqualMethod · 0.65
LenMethod · 0.65
ValMethod · 0.45

Tested by

no test coverage detected