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

Function TestConcatWithExpr

concat_test.go:92–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestConcatWithExpr(t *testing.T) {
93 a, b, _ := sampleForConcat(t)
94 a.AddColumn("upper_ville", datatable.String, datatable.Expr("UPPER(ville)"))
95 b.AddColumn("upper_ville", datatable.String, datatable.Expr("UPPER(ville)"))
96
97 dt, err := a.Concat(b)
98 assert.NoError(t, err)
99 assert.Equal(t, "magasin1", dt.Name())
100 assert.Equal(t, 8, dt.NumRows())
101
102 checkTable(t, dt,
103 "prenom", "nom", "ville", "date_naissance", "total_achat", "upper_ville",
104 "Léon", "Dupuis", "Paris", time.Date(1983, time.March, 6, 0, 0, 0, 0, time.UTC), int64(135), "PARIS",
105 "Marie", "Bernard", "Paris", time.Date(1993, time.July, 3, 0, 0, 0, 0, time.UTC), int64(75), "PARIS",
106 "Sophie", "Dupond", "Marseille", time.Date(1986, time.February, 22, 0, 0, 0, 0, time.UTC), int64(27), "MARSEILLE",
107 "Marcel", "Martin", "Paris", time.Date(1976, time.November, 24, 0, 0, 0, 0, time.UTC), int64(39), "PARIS",
108 "Marion", "Leroy", "Lyon", time.Date(1982, time.October, 27, 0, 0, 0, 0, time.UTC), int64(285), "LYON",
109 "Paul", "Moreau", "Lyon", time.Date(1976, time.April, 19, 0, 0, 0, 0, time.UTC), int64(133), "LYON",
110 "Marie", "Bernard", "Paris", time.Date(1993, time.July, 3, 0, 0, 0, 0, time.UTC), int64(75), "PARIS",
111 "Marcel", "Martin", "Paris", time.Date(1976, time.November, 24, 0, 0, 0, 0, time.UTC), int64(39), "PARIS",
112 )
113}

Callers

nothing calls this directly

Calls 7

ExprFunction · 0.92
sampleForConcatFunction · 0.85
checkTableFunction · 0.85
AddColumnMethod · 0.80
NumRowsMethod · 0.80
ConcatMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected