MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestAddOrderBy

Function TestAddOrderBy

pkg/transform/orderby_test.go:21–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestAddOrderBy(t *testing.T) {
22 stmt := mustParse(t, "SELECT * FROM users")
23 err := Apply(stmt, AddOrderBy("created_at", true))
24 if err != nil {
25 t.Fatal(err)
26 }
27 out := format(stmt)
28 assertContains(t, out, "ORDER BY")
29 assertContains(t, out, "created_at")
30 assertContains(t, out, "DESC")
31}
32
33func TestAddOrderBy_Ascending(t *testing.T) {
34 stmt := mustParse(t, "SELECT * FROM users")

Callers

nothing calls this directly

Calls 5

mustParseFunction · 0.85
ApplyFunction · 0.85
AddOrderByFunction · 0.85
assertContainsFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected