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

Function TestJoinWithColumnName

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

Source from the content-addressed store, hash-verified

186}
187
188func TestJoinWithColumnName(t *testing.T) {
189 customers, orders := sampleForJoin()
190 assert.NoError(t, customers.RenameColumn("id", "ClientID"))
191
192 dt, err := customers.InnerJoin(orders, datatable.On("[Customers].[ClientID]", "[Orders].[user_id]"))
193 assert.NoError(t, err)
194 assert.NotNil(t, dt)
195
196 checkTable(t, dt,
197 "ClientID", "prenom", "nom", "email", "ville", "date_achat", "num_facture", "prix_total",
198 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", time.Date(2013, time.January, 23, 0, 0, 0, 0, time.UTC), "A00103", 203.14,
199 1, "Aimée", "Marechal", "aime.marechal@example.com", "Paris", time.Date(2013, time.February, 14, 0, 0, 0, 0, time.UTC), "A00104", 124.00,
200 2, "Esmée", "Lefort", "esmee.lefort@example.com", "Lyon", time.Date(2013, time.February, 17, 0, 0, 0, 0, time.UTC), "A00105", 149.45,
201 3, "Marine", "Prevost", "m.prevost@example.com", "Lille", time.Date(2013, time.February, 21, 0, 0, 0, 0, time.UTC), "A00106", 235.35,
202 )
203}

Callers

nothing calls this directly

Calls 5

OnFunction · 0.92
sampleForJoinFunction · 0.85
checkTableFunction · 0.85
RenameColumnMethod · 0.80
InnerJoinMethod · 0.80

Tested by

no test coverage detected