Browse Source

Merge branch 'pr-wpsBlankLine' of https://github.com/bronze1man/xlsx into bronze1man-pr-wpsBlankLine

Geoffrey J. Teale 12 years ago
parent
commit
15bd4af234
2 changed files with 29 additions and 0 deletions
  1. BIN
      wpsBlankLineTest.xlsx
  2. 29 0
      wpsBlankLine_test.go

BIN
wpsBlankLineTest.xlsx


+ 29 - 0
wpsBlankLine_test.go

@@ -0,0 +1,29 @@
+package xlsx
+
+import (
+	"testing"
+)
+
+// Test that we can successfully read an XLSX file generated by
+// Wps on windows. you can download it freely from http://www.wps.cn/
+func TestWpsBlankLine(t *testing.T) {
+	xlsxFile, error := OpenFile("wpsBlankLineTest.xlsx")
+	if error != nil {
+		t.Error(error.Error())
+		return
+	}
+	if xlsxFile == nil {
+		t.Error("OpenFile returned nil FileInterface without generating an os.Error")
+		return
+	}
+	s := xlsxFile.Sheets[0].Cell(0, 0).String()
+	if s != "编号" {
+		t.Errorf("[TestMacExcel] xlsxFile.Sheets[0].Cell(0,0).String():'%s'", s)
+		return
+	}
+	s = xlsxFile.Sheets[0].Cell(0, 2).String()
+	if s != "编号" {
+		t.Errorf("[TestMacExcel] xlsxFile.Sheets[0].Cell(0,0).String():'%s'", s)
+		return
+	}
+}