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

Function TestDialectValueWriting

expr/dialect_test.go:66–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64 }
65}
66func TestDialectValueWriting(t *testing.T) {
67 // Test value writing
68 for _, tc := range []struct {
69 in value.Value
70 out string
71 }{
72 {value.NewValue(true), "true"},
73 {value.NewValue(22.2), "22.2"},
74 {value.NewValue(dateparse.MustParse("2017/08/08")), "\"2017-08-08 00:00:00 +0000 UTC\""},
75 {value.NewValue(22), "22"},
76 {value.NewValue("world"), `"world"`},
77 {value.NewValue(json.RawMessage(`{"name":"world"}`)), `{"name":"world"}`},
78 } {
79 dw := NewDialectWriter('"', '[')
80 dw.WriteValue(tc.in)
81 assert.Equal(t, tc.out, dw.String())
82 }
83}

Callers

nothing calls this directly

Calls 5

WriteValueMethod · 0.95
StringMethod · 0.95
NewValueFunction · 0.92
NewDialectWriterFunction · 0.85
EqualMethod · 0.65

Tested by

no test coverage detected