20
0
xls/issue47_test.go

31 lines
670 B
Go
Raw Normal View History

package xls
import (
2019-03-05 21:25:31 +01:00
"io/ioutil"
"path"
"path/filepath"
"strings"
"testing"
)
func TestIssue47(t *testing.T) {
2019-03-05 21:25:31 +01:00
testdatapath := "testdata"
files, err := ioutil.ReadDir(testdatapath)
if err != nil {
t.Fatalf("Cant read testdata directory contents: %s", err)
}
for _, f := range files {
if filepath.Ext(f.Name()) == ".xls" {
xlsfilename := f.Name()
xlsxfilename := strings.TrimSuffix(xlsfilename, filepath.Ext(xlsfilename)) + ".xlsx"
2019-03-06 21:13:03 +01:00
err := CompareXlsXlsx(path.Join(testdatapath, xlsfilename),
2019-03-05 21:25:31 +01:00
path.Join(testdatapath, xlsxfilename))
if err != "" {
t.Fatalf("XLS file %s an XLSX file are not equal: %s", xlsfilename, err)
}
2019-03-05 21:25:31 +01:00
}
}
}