|
|
@@ -1,24 +1,19 @@
|
|
|
package xlsx
|
|
|
|
|
|
import (
|
|
|
- "testing"
|
|
|
+ . "gopkg.in/check.v1"
|
|
|
)
|
|
|
|
|
|
+type MacNumbersSuite struct {}
|
|
|
+var _ = Suite(&MacNumbersSuite{})
|
|
|
+
|
|
|
+
|
|
|
// Test that we can successfully read an XLSX file generated by
|
|
|
// Numbers for Mac.
|
|
|
-func TestMacNumbers(t *testing.T) {
|
|
|
- xlsxFile, error := OpenFile("macNumbersTest.xlsx")
|
|
|
- if error != nil {
|
|
|
- t.Error(error.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- if xlsxFile == nil {
|
|
|
- t.Error("OpenFile returned nil FileInterface without generating an os.Error")
|
|
|
- return
|
|
|
- }
|
|
|
+func (m *MacNumbersSuite) TestMacNumbers(c *C) {
|
|
|
+ xlsxFile, err := OpenFile("macNumbersTest.xlsx")
|
|
|
+ c.Assert(err, IsNil)
|
|
|
+ c.Assert(xlsxFile, NotNil)
|
|
|
s := xlsxFile.Sheets[0].Cell(0, 0).String()
|
|
|
- if s != "编号" {
|
|
|
- t.Errorf("[TestMacExcel] xlsxFile.Sheets[0].Cell(0,0).String():'%s'", s)
|
|
|
- return
|
|
|
- }
|
|
|
+ c.Assert(s, Equals, "编号")
|
|
|
}
|