package sheets import "testing" func TestTextCell(t *testing.T) { if got := TextCell("0308"); got != "'0308" { t.Errorf(`TextCell("0308"): got %q`, got) } if got := TextCell(""); got != "" { t.Errorf(`TextCell(""): got %q`, got) } } func TestCellString(t *testing.T) { cases := []struct { name string in any want string }{ {"nil", nil, ""}, {"string", "fee", "fee"}, {"string with leading zeros", "0308", "0308"}, {"small integer float", 123.0, "123"}, {"large integer float", 2609767878.0, "2609767878"}, {"eleven digit float", 26123456789.0, "26123456789"}, {"fractional float", 12.5, "12.5"}, {"bool", true, "true"}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { if got := CellString(tc.in); got != tc.want { t.Errorf("CellString(%v): want %q, got %q", tc.in, tc.want, got) } }) } }