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

Method TestSubExpr

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

Source from the content-addressed store, hash-verified

136}
137
138func (s *ExprSuite) TestSubExpr(c *gc.C) {
139 expr := Sub(Literal(1), Literal(2), Literal(3))
140
141 buf := &bytes.Buffer{}
142
143 err := expr.SerializeSql(buf)
144 c.Assert(err, gc.IsNil)
145
146 sql := buf.String()
147 c.Assert(sql, gc.Equals, "(1 - 2 - 3)")
148}
149
150func (s *ExprSuite) TestMulExpr(c *gc.C) {
151 expr := Mul(Literal(1), Literal(2), Literal(3))

Callers

nothing calls this directly

Calls 4

SubFunction · 0.85
LiteralFunction · 0.85
SerializeSqlMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected