macExcel_test.go 678 B

1234567891011121314151617181920212223242526
  1. package xlsx
  2. import (
  3. "testing"
  4. )
  5. // Test that we can successfully read an XLSX file generated by
  6. // Microsoft Excel for Mac. In particular this requires that we
  7. // respect the contents of workbook.xml.rels, which maps the sheet IDs
  8. // to their internal file names.
  9. func TestMacExcel(t *testing.T) {
  10. xlsxFile, error := OpenFile("macExcelTest.xlsx")
  11. if error != nil {
  12. t.Error(error.Error())
  13. return
  14. }
  15. if xlsxFile == nil {
  16. t.Error("OpenFile returned nil FileInterface without generating an os.Error")
  17. return
  18. }
  19. s := xlsxFile.Sheets[0].Cell(0, 0).String()
  20. if s != "编号" {
  21. t.Errorf("[TestMacExcel] xlsxFile.Sheets[0].Cell(0,0).String():'%s'", s)
  22. return
  23. }
  24. }