MCPcopy
hub / github.com/cube2222/octosql / TestAppend

Function TestAppend

parser/sqlparser/ast_test.go:34–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32)
33
34func TestAppend(t *testing.T) {
35 query := "select * from t where a = 1"
36 tree, err := Parse(query)
37 if err != nil {
38 t.Error(err)
39 }
40 var b strings.Builder
41 Append(&b, tree)
42 got := b.String()
43 want := query
44 if got != want {
45 t.Errorf("Append: %s, want %s", got, want)
46 }
47 Append(&b, tree)
48 got = b.String()
49 want = query + query
50 if got != want {
51 t.Errorf("Append: %s, want %s", got, want)
52 }
53}
54
55func TestSelect(t *testing.T) {
56 tree, err := Parse("select * from t where a = 1")

Callers

nothing calls this directly

Calls 4

ParseFunction · 0.85
AppendFunction · 0.85
ErrorMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected