wpsBlankLine_test.go 802 B

1234567891011121314151617181920212223242526272829303132333435
  1. package xlsx
  2. import (
  3. . "gopkg.in/check.v1"
  4. )
  5. type WpsBlankLineSuite struct {}
  6. var _ = Suite(&WorksheetSuite{})
  7. // Test that we can successfully read an XLSX file generated by
  8. // Wps on windows. you can download it freely from http://www.wps.cn/
  9. func (w *WpsBlankLineSuite) TestWpsBlankLine(c *C) {
  10. xlsxFile, err := OpenFile("wpsBlankLineTest.xlsx")
  11. c.Assert(err, IsNil)
  12. c.Assert(xlsxFile, NotNil)
  13. sheet := xlsxFile.Sheets[0]
  14. row := sheet.Rows[0]
  15. cell := row.Cells[0]
  16. s := cell.String()
  17. expected := "编号"
  18. c.Assert(s, Equals, expected)
  19. row = sheet.Rows[2]
  20. cell = row.Cells[0]
  21. s = cell.String()
  22. c.Assert(s, Equals, expected)
  23. row = sheet.Rows[4]
  24. cell = row.Cells[1]
  25. s = cell.String()
  26. c.Assert(s, Equals, "")
  27. s = sheet.Rows[4].Cells[2].String()
  28. c.Assert(s, Equals, expected)
  29. }