summaryrefslogtreecommitdiff
path: root/calc_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'calc_test.go')
-rw-r--r--calc_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/calc_test.go b/calc_test.go
index 54629a6..a391a19 100644
--- a/calc_test.go
+++ b/calc_test.go
@@ -2217,6 +2217,8 @@ func TestCalcCellValue(t *testing.T) {
"=MATCH(0,A1:A1,\"x\")": "MATCH requires numeric match_type argument",
"=MATCH(0,A1)": "MATCH arguments lookup_array should be one-dimensional array",
"=MATCH(0,A1:B1)": "MATCH arguments lookup_array should be one-dimensional array",
+ // TRANSPOSE
+ "=TRANSPOSE()": "TRANSPOSE requires 1 argument",
// VLOOKUP
"=VLOOKUP()": "VLOOKUP requires at least 3 arguments",
"=VLOOKUP(D2,D1,1,FALSE)": "VLOOKUP requires second argument of table array",
@@ -2611,6 +2613,21 @@ func TestCalcMatchPattern(t *testing.T) {
assert.False(t, matchPattern("file/?", "file/abc/bcd/def"))
}
+func TestCalcTRANSPOSE(t *testing.T) {
+ cellData := [][]interface{}{
+ {"a", "d"},
+ {"b", "e"},
+ {"c", "f"},
+ }
+ formula := "=TRANSPOSE(A1:A3)"
+ f := prepareCalcData(cellData)
+ formulaType, ref := STCellFormulaTypeArray, "D1:F2"
+ assert.NoError(t, f.SetCellFormula("Sheet1", "D1", formula,
+ FormulaOpts{Ref: &ref, Type: &formulaType}))
+ _, err := f.CalcCellValue("Sheet1", "D1")
+ assert.NoError(t, err, formula)
+}
+
func TestCalcVLOOKUP(t *testing.T) {
cellData := [][]interface{}{
{nil, nil, nil, nil, nil, nil},