forked from p30928647/excelize
- Update unit tests Co-authored-by: jayhoo <hujie@ynningneng.com>
This commit is contained in:
parent
aa80fa4179
commit
dde6b9c001
7
calc.go
7
calc.go
|
@ -13960,13 +13960,10 @@ func (fn *formulaFuncs) ADDRESS(argsList *list.List) formulaArg {
|
|||
}
|
||||
var sheetText string
|
||||
if argsList.Len() == 5 {
|
||||
sheetText = trimSheetName(argsList.Back().Value.(formulaArg).Value())
|
||||
}
|
||||
if len(sheetText) > 0 {
|
||||
sheetText = fmt.Sprintf("%s!", sheetText)
|
||||
sheetText = fmt.Sprintf("%s!", trimSheetName(argsList.Back().Value.(formulaArg).Value()))
|
||||
}
|
||||
formatter := addressFmtMaps[fmt.Sprintf("%d_%s", int(absNum.Number), a1.Value())]
|
||||
addr, err := formatter(int(colNum.Number), int(colNum.Number))
|
||||
addr, err := formatter(int(colNum.Number), int(rowNum.Number))
|
||||
if err != nil {
|
||||
return newErrorFormulaArg(formulaErrorVALUE, formulaErrorVALUE)
|
||||
}
|
||||
|
|
11
calc_test.go
11
calc_test.go
|
@ -1800,14 +1800,23 @@ func TestCalcCellValue(t *testing.T) {
|
|||
// Excel Lookup and Reference Functions
|
||||
// ADDRESS
|
||||
"=ADDRESS(1,1,1,TRUE)": "$A$1",
|
||||
"=ADDRESS(1,2,1,TRUE)": "$B$1",
|
||||
"=ADDRESS(1,1,1,FALSE)": "R1C1",
|
||||
"=ADDRESS(1,2,1,FALSE)": "R1C2",
|
||||
"=ADDRESS(1,1,2,TRUE)": "A$1",
|
||||
"=ADDRESS(1,2,2,TRUE)": "B$1",
|
||||
"=ADDRESS(1,1,2,FALSE)": "R1C[1]",
|
||||
"=ADDRESS(1,2,2,FALSE)": "R1C[2]",
|
||||
"=ADDRESS(1,1,3,TRUE)": "$A1",
|
||||
"=ADDRESS(1,2,3,TRUE)": "$B1",
|
||||
"=ADDRESS(1,1,3,FALSE)": "R[1]C1",
|
||||
"=ADDRESS(1,2,3,FALSE)": "R[1]C2",
|
||||
"=ADDRESS(1,1,4,TRUE)": "A1",
|
||||
"=ADDRESS(1,2,4,TRUE)": "B1",
|
||||
"=ADDRESS(1,1,4,FALSE)": "R[1]C[1]",
|
||||
"=ADDRESS(1,1,4,TRUE,\"\")": "A1",
|
||||
"=ADDRESS(1,2,4,FALSE)": "R[1]C[2]",
|
||||
"=ADDRESS(1,1,4,TRUE,\"\")": "!A1",
|
||||
"=ADDRESS(1,2,4,TRUE,\"\")": "!B1",
|
||||
"=ADDRESS(1,1,4,TRUE,\"Sheet1\")": "Sheet1!A1",
|
||||
// CHOOSE
|
||||
"=CHOOSE(4,\"red\",\"blue\",\"green\",\"brown\")": "brown",
|
||||
|
|
Loading…
Reference in New Issue