summaryrefslogtreecommitdiff
path: root/excelize_test.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2016-09-02 10:28:29 +0800
committerRi Xu <xuri.me@gmail.com>2016-09-02 10:28:29 +0800
commit0a0a36bafd160752c2af914ab3bdb1d28665ebe3 (patch)
treeb6a6a271854b14ac78da401f7bcb51288ca73af4 /excelize_test.go
parent2d0eda1aec6f9133e87144d64564051310b58a90 (diff)
Update testing file more case added and reading cell value usage example in readme added.
Diffstat (limited to 'excelize_test.go')
-rw-r--r--excelize_test.go19
1 files changed, 15 insertions, 4 deletions
diff --git a/excelize_test.go b/excelize_test.go
index 69f7964..456455e 100644
--- a/excelize_test.go
+++ b/excelize_test.go
@@ -9,7 +9,7 @@ func TestExcelize(t *testing.T) {
// Test update a XLSX file
file, err := OpenFile("./test/Workbook1.xlsx")
if err != nil {
- t.Error(err)
+ t.Log(err)
}
file = SetCellInt(file, "SHEET2", "B2", 100)
file = SetCellStr(file, "SHEET2", "C11", "Knowns")
@@ -18,12 +18,21 @@ func TestExcelize(t *testing.T) {
file = SetCellStr(file, "SHEET3", "b230", "10")
file = SetActiveSheet(file, 2)
if err != nil {
- t.Error(err)
+ t.Log(err)
}
for i := 1; i <= 300; i++ {
file = SetCellStr(file, "SHEET3", "c"+strconv.Itoa(i), strconv.Itoa(i))
}
err = Save(file, "./test/Workbook_2.xlsx")
+ if err != nil {
+ t.Log(err)
+ }
+
+ // Test save to not exist directory
+ err = Save(file, "")
+ if err != nil {
+ t.Log(err)
+ }
// Test create a XLSX file
file2 := CreateFile()
@@ -31,18 +40,20 @@ func TestExcelize(t *testing.T) {
file2 = NewSheet(file2, 3, "TestSheet3")
file2 = SetCellInt(file2, "Sheet2", "A23", 10)
file2 = SetCellStr(file2, "SHEET1", "B20", "10")
+ file2 = SetActiveSheet(file2, 0)
err = Save(file2, "./test/Workbook_3.xlsx")
if err != nil {
- t.Error(err)
+ t.Log(err)
}
// Test read cell value
file, err = OpenFile("./test/Workbook1.xlsx")
if err != nil {
- t.Error(err)
+ t.Log(err)
}
GetCellValue(file, "Sheet2", "a-1")
GetCellValue(file, "Sheet2", "a5")
+ GetCellValue(file, "Sheet2", "C11")
GetCellValue(file, "Sheet2", "D11")
GetCellValue(file, "Sheet2", "D12")
GetCellValue(file, "Sheet2", "E12")