wpsBlankLine_test.go 839 B

1234567891011121314151617181920212223242526272829303132333435
  1. package xlsx
  2. import (
  3. "testing"
  4. )
  5. // Test that we can successfully read an XLSX file generated by
  6. // Wps on windows. you can download it freely from http://www.wps.cn/
  7. func TestWpsBlankLine(t *testing.T) {
  8. xlsxFile, error := OpenFile("wpsBlankLineTest.xlsx")
  9. if error != nil {
  10. t.Error(error.Error())
  11. return
  12. }
  13. if xlsxFile == nil {
  14. t.Error("OpenFile returned nil FileInterface without generating an os.Error")
  15. return
  16. }
  17. sheet := xlsxFile.Sheets[0]
  18. row := sheet.Rows[0]
  19. cell := row.Cells[0]
  20. s := cell.String()
  21. expected := "编号"
  22. if s != expected {
  23. t.Errorf("[TestMacExcel] expected cell A1 = '%s'', but got :'%s'", expected, s)
  24. return
  25. }
  26. row = sheet.Rows[2]
  27. cell = row.Cells[0]
  28. s = cell.String()
  29. if s != expected {
  30. t.Errorf("[TestMacExcel] expected cell A3 = '%s'', but got :'%s'", expected, s)
  31. return
  32. }
  33. }