MCPcopy Create free account
hub / github.com/datasweet/datatable / TestJoinOn

Function TestJoinOn

join_test.go:35–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestJoinOn(t *testing.T) {
36 on := datatable.On("[customers].[id]")
37 assert.NotNil(t, on)
38 assert.Len(t, on, 1)
39 assert.Equal(t, "customers", on[0].Table)
40 assert.Equal(t, "id", on[0].Field)
41
42 on = datatable.On("[id]")
43 assert.NotNil(t, on)
44 assert.Len(t, on, 1)
45 assert.Equal(t, "*", on[0].Table)
46 assert.Equal(t, "id", on[0].Field)
47
48 on = datatable.On("id")
49 assert.NotNil(t, on)
50 assert.Len(t, on, 1)
51 assert.Equal(t, "*", on[0].Table)
52 assert.Equal(t, "id", on[0].Field)
53
54 on = datatable.On("customers.[id]")
55 assert.NotNil(t, on)
56 assert.Len(t, on, 1)
57 assert.Equal(t, "*", on[0].Table)
58 assert.Equal(t, "customers.[id]", on[0].Field)
59}
60
61func TestInnerJoin(t *testing.T) {
62 customers, orders := sampleForJoin()

Callers

nothing calls this directly

Calls 2

OnFunction · 0.92
LenMethod · 0.45

Tested by

no test coverage detected