MCPcopy Create free account
hub / github.com/buger/goterm / TestCreateDataTable

Function TestCreateDataTable

plot_test.go:10–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestCreateDataTable(t *testing.T) {
11 data := new(DataTable)
12
13 data.AddColumn("Gender")
14 data.AddColumn("Age")
15
16 if len(data.columns) != 2 {
17 t.Error("Should be 2 columns")
18 }
19
20 if data.columns[1] != "Age" {
21 t.Error("Should have proper column name")
22 }
23
24 data.AddRow(1, 5)
25 data.AddRow(0, 4)
26
27 if len(data.rows) != 2 {
28 t.Error("Should have 2 rows")
29 }
30
31 if data.rows[1][0] != 0 && data.rows[1][1] != 4 {
32 t.Error("Row should be properly inserted")
33 }
34}
35
36func TestLineChartIndependent(t *testing.T) {
37 fmt.Print("Independent charts\n\n")

Callers

nothing calls this directly

Calls 2

AddColumnMethod · 0.80
AddRowMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…