فهرست منبع

Update readme and comments of the test file.

Ri Xu 9 سال پیش
والد
کامیت
db47b6750d
2فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 3 3
      README.md
  2. 4 1
      excelize_test.go

+ 3 - 3
README.md

@@ -39,7 +39,7 @@ func main() {
     xlsx = excelize.NewSheet(xlsx, 3, "Sheet3")
     xlsx = excelize.SetCellInt(xlsx, "Sheet2", "A23", 10)
     xlsx = excelize.SetCellStr(xlsx, "Sheet3", "B20", "Hello")
-    err := excelize.Save(xlsx, "~/Workbook.xlsx")
+    err := excelize.Save(xlsx, "/home/Workbook.xlsx")
     if err != nil {
         fmt.Println(err)
     }
@@ -59,7 +59,7 @@ import (
 )
 
 func main() {
-    xlsx, err := excelize.OpenFile("~/Workbook.xlsx")
+    xlsx, err := excelize.OpenFile("/home/Workbook.xlsx")
     if err != nil {
         fmt.Println(err)
     }
@@ -87,7 +87,7 @@ import (
 )
 
 func main() {
-    xlsx, err := excelize.OpenFile("~/Workbook.xlsx")
+    xlsx, err := excelize.OpenFile("/home/Workbook.xlsx")
     if err != nil {
         fmt.Println(err)
     }

+ 4 - 1
excelize_test.go

@@ -51,10 +51,13 @@ func TestExcelize(t *testing.T) {
 	if err != nil {
 		t.Log(err)
 	}
+	// Test given illegal rows number
 	GetCellValue(file, "Sheet2", "a-1")
+	// Test given lowercase column number
 	GetCellValue(file, "Sheet2", "a5")
 	GetCellValue(file, "Sheet2", "C11")
 	GetCellValue(file, "Sheet2", "D11")
 	GetCellValue(file, "Sheet2", "D12")
-	GetCellValue(file, "Sheet2", "E12")
+	// Test given axis large than exists row
+	GetCellValue(file, "Sheet2", "E13")
 }