mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-17 08:18:51 +00:00
24 lines
638 B
Go
24 lines
638 B
Go
package leadsync
|
|
|
|
import "testing"
|
|
|
|
func TestBuildA1RangeReadsEveryColumn(t *testing.T) {
|
|
tests := []struct {
|
|
name, tab string
|
|
maxRows int
|
|
want string
|
|
}{
|
|
{"whole first tab", "", 0, "A:ZZZ"},
|
|
{"whole named tab", "Leads", 0, "'Leads'!A:ZZZ"},
|
|
{"preview of a named tab", " Leads ", 21, "'Leads'!A1:ZZZ21"},
|
|
{"a quote in the tab title is doubled", "Q4 'hot'", 0, "'Q4 ''hot'''!A:ZZZ"},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := buildA1Range(tt.tab, tt.maxRows); got != tt.want {
|
|
t.Errorf("buildA1Range(%q, %d) = %q, want %q", tt.tab, tt.maxRows, got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|