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

Function TestLeftJoin

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

Source from the content-addressed store, hash-verified

74}
75
76func TestLeftJoin(t *testing.T) {
77 customers, orders := sampleForJoin()
78
79 dt, err := customers.LeftJoin(orders, datatable.On("[Customers].[id]", "[Orders].[user_id]"))
80 assert.NoError(t, err)
81 assert.NotNil(t, dt)
82
83 checkTable(t, dt,
84 "id", "prenom", "nom", "email", "ville", "date_achat", "num_facture", "prix_total",
85 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", time.Date(2013, time.January, 23, 0, 0, 0, 0, time.UTC), "A00103", 203.14,
86 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", time.Date(2013, time.February, 14, 0, 0, 0, 0, time.UTC), "A00104", 124.00,
87 2, "Esmée", "Lefort", "esmee.lefort@example.com", "Lyon", time.Date(2013, time.February, 17, 0, 0, 0, 0, time.UTC), "A00105", 149.45,
88 3, "Marine", "Prevost", "m.prevost@example.com", "Lille", time.Date(2013, time.February, 21, 0, 0, 0, 0, time.UTC), "A00106", 235.35,
89 4, "Luc", "Rolland", "lucrolland@example.com", "Marseille", nil, nil, nil,
90 )
91}
92
93func TestRightJoin(t *testing.T) {
94 customers, orders := sampleForJoin()

Callers

nothing calls this directly

Calls 4

OnFunction · 0.92
sampleForJoinFunction · 0.85
checkTableFunction · 0.85
LeftJoinMethod · 0.80

Tested by

no test coverage detected