MCPcopy
hub / github.com/dropbox/godropbox / TestAddExpr

Method TestAddExpr

database/sqlbuilder/expression_test.go:126–136  ·  view source on GitHub ↗
(c *gc.C)

Source from the content-addressed store, hash-verified

124}
125
126func (s *ExprSuite) TestAddExpr(c *gc.C) {
127 expr := Add(Literal(1), Literal(2), Literal(3))
128
129 buf := &bytes.Buffer{}
130
131 err := expr.SerializeSql(buf)
132 c.Assert(err, gc.IsNil)
133
134 sql := buf.String()
135 c.Assert(sql, gc.Equals, "(1 + 2 + 3)")
136}
137
138func (s *ExprSuite) TestSubExpr(c *gc.C) {
139 expr := Sub(Literal(1), Literal(2), Literal(3))

Callers

nothing calls this directly

Calls 4

AddFunction · 0.85
LiteralFunction · 0.85
SerializeSqlMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected