当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 162

xiaoQian/excelize
暂停

forked from xuri/excelize 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cell_test.go 951 Bytes
一键复制 编辑 原始数据 按行查看 历史
xuri 提交于 2018-01-31 11:12 . - gofmted with -s;
package excelize
import "testing"
func TestCheckCellInArea(t *testing.T) {
expectedTrueCellInAreaList := [][2]string{
{"c2", "A1:AAZ32"},
{"AA0", "Z0:AB1"},
{"B9", "A1:B9"},
{"C2", "C2:C2"},
}
for _, expectedTrueCellInArea := range expectedTrueCellInAreaList {
cell := expectedTrueCellInArea[0]
area := expectedTrueCellInArea[1]
cellInArea := checkCellInArea(cell, area)
if !cellInArea {
t.Fatalf("Expected cell %v to be in area %v, got false\n", cell, area)
}
}
expectedFalseCellInAreaList := [][2]string{
{"c2", "A4:AAZ32"},
{"C4", "D6:A1"}, // weird case, but you never know
{"AEF42", "BZ40:AEF41"},
}
for _, expectedFalseCellInArea := range expectedFalseCellInAreaList {
cell := expectedFalseCellInArea[0]
area := expectedFalseCellInArea[1]
cellInArea := checkCellInArea(cell, area)
if cellInArea {
t.Fatalf("Expected cell %v not to be inside of area %v, but got true\n", cell, area)
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/maniaq/excelize.git
git@gitee.com:maniaq/excelize.git
maniaq
excelize
excelize
master

搜索帮助