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

猫叔/excelize
暂停

forked from xuri/excelize 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lib_test.go 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
Veniamin Albaev 提交于 2018-12-27 13:51 . Tests refactoring
package excelize
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestAxisLowerOrEqualThanIsTrue(t *testing.T) {
trueExpectedInputList := [][2]string{
{"A", "B"},
{"A", "AA"},
{"B", "AA"},
{"BC", "ABCD"},
{"1", "2"},
{"2", "11"},
}
for i, trueExpectedInput := range trueExpectedInputList {
t.Run(fmt.Sprintf("TestData%d", i), func(t *testing.T) {
assert.True(t, axisLowerOrEqualThan(trueExpectedInput[0], trueExpectedInput[1]))
})
}
}
func TestAxisLowerOrEqualThanIsFalse(t *testing.T) {
falseExpectedInputList := [][2]string{
{"B", "A"},
{"AA", "A"},
{"AA", "B"},
{"ABCD", "AB"},
{"2", "1"},
{"11", "2"},
}
for i, falseExpectedInput := range falseExpectedInputList {
t.Run(fmt.Sprintf("TestData%d", i), func(t *testing.T) {
assert.False(t, axisLowerOrEqualThan(falseExpectedInput[0], falseExpectedInput[1]))
})
}
}
func TestGetCellColRow(t *testing.T) {
cellExpectedColRowList := [][3]string{
{"C220", "C", "220"},
{"aaef42", "aaef", "42"},
{"bonjour", "bonjour", ""},
{"59", "", "59"},
{"", "", ""},
}
for i, test := range cellExpectedColRowList {
t.Run(fmt.Sprintf("TestData%d", i), func(t *testing.T) {
col, row := getCellColRow(test[0])
assert.Equal(t, test[1], col, "Unexpected col")
assert.Equal(t, test[2], row, "Unexpected row")
})
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/fatfatcat/excelize.git
git@gitee.com:fatfatcat/excelize.git
fatfatcat
excelize
excelize
master

搜索帮助