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

Method TestTupleExpr

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

Source from the content-addressed store, hash-verified

43}
44
45func (s *ExprSuite) TestTupleExpr(c *gc.C) {
46
47 expr := Tuple()
48 buf := &bytes.Buffer{}
49 err := expr.SerializeSql(buf)
50 c.Assert(err, gc.NotNil)
51
52 expr = Tuple(table1Col1, Literal(1), Literal("five"))
53 err = expr.SerializeSql(buf)
54 c.Assert(err, gc.IsNil)
55
56 sql := buf.String()
57 c.Assert(
58 sql,
59 gc.Equals,
60 "(`table1`.`col1`,1,'five')")
61
62}
63
64func (s *ExprSuite) TestLikeExpr(c *gc.C) {
65 expr := LikeL(table1Col1, EscapeForLike("%my_prefix")+"%")

Callers

nothing calls this directly

Calls 4

TupleFunction · 0.85
LiteralFunction · 0.85
SerializeSqlMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected