(t *testing.T)
| 107 | } |
| 108 | |
| 109 | func TestAppendRow(t *testing.T) { |
| 110 | tb := datatable.New("test") |
| 111 | assert.NoError(t, tb.AddColumn("champ", datatable.String)) |
| 112 | assert.NoError(t, tb.AddColumn("win", datatable.Int)) |
| 113 | assert.NoError(t, tb.AddColumn("loose", datatable.Int)) |
| 114 | assert.NoError(t, tb.AddColumn("winRate", datatable.Float64, datatable.Expr("(`win` * 100 / (`win` + `loose`))"))) |
| 115 | assert.Error(t, tb.AddColumn("winRate", datatable.String, datatable.Expr("test"))) |
| 116 | |
| 117 | assert.NoError(t, tb.AppendRow("Xerath", 25, 15, "expr")) |
| 118 | assert.NoError(t, tb.AppendRow("Malzahar", 16, 16, nil)) |
| 119 | assert.NoError(t, tb.AppendRow("Vel'Koz", 7, 5, 3)) |
| 120 | |
| 121 | checkTable(t, tb, |
| 122 | "champ", "win", "loose", "winRate", |
| 123 | "Xerath", 25, 15, 62.5, |
| 124 | "Malzahar", 16, 16, 50.0, |
| 125 | "Vel'Koz", 7, 5, 58.333333333333336, |
| 126 | ) |
| 127 | } |
| 128 | |
| 129 | func TestRows(t *testing.T) { |
| 130 | tb := datatable.New("test") |
nothing calls this directly
no test coverage detected