macNumbers_test.go 533 B

123456789101112131415161718192021222324
  1. package xlsx
  2. import (
  3. "testing"
  4. )
  5. // Test that we can successfully read an XLSX file generated by
  6. // Numbers for Mac.
  7. func TestMacNumbers(t *testing.T) {
  8. xlsxFile, error := OpenFile("macNumbersTest.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. s := xlsxFile.Sheets[0].Cell(0, 0).String()
  18. if s != "编号" {
  19. t.Errorf("[TestMacExcel] xlsxFile.Sheets[0].Cell(0,0).String():'%s'", s)
  20. return
  21. }
  22. }