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

Method TestOrExpr

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

Source from the content-addressed store, hash-verified

109}
110
111func (s *ExprSuite) TestOrExpr(c *gc.C) {
112 expr := Or(EqL(table1Col1, 1), EqL(table1Col2, 2), EqL(table1Col3, 3))
113
114 buf := &bytes.Buffer{}
115
116 err := expr.SerializeSql(buf)
117 c.Assert(err, gc.IsNil)
118
119 sql := buf.String()
120 c.Assert(
121 sql,
122 gc.Equals,
123 "(`table1`.`col1`=1 OR `table1`.`col2`=2 OR `table1`.`col3`=3)")
124}
125
126func (s *ExprSuite) TestAddExpr(c *gc.C) {
127 expr := Add(Literal(1), Literal(2), Literal(3))

Callers

nothing calls this directly

Calls 4

OrFunction · 0.85
EqLFunction · 0.85
SerializeSqlMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected