|
@@ -26,6 +26,25 @@ func TestXVDoc(t *testing.T) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func TestImage(t *testing.T) {
|
|
|
|
+ if src, err := ioutil.ReadFile("z_image.json"); err == nil {
|
|
|
|
+ if docs, err := FromJSON(src); err == nil {
|
|
|
|
+ log.Println("!!!!!!!", len(docs), docs)
|
|
|
|
+ log.Println("=============================")
|
|
|
|
+ if exp, err := Export("xlsx", docs); err == nil {
|
|
|
|
+ ioutil.WriteFile("tmp.xlsx", exp, 0660)
|
|
|
|
+ } else {
|
|
|
|
+ log.Println(err)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ t.Error(err)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ t.Error(err)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
func TestXLSXImport(t *testing.T) {
|
|
func TestXLSXImport(t *testing.T) {
|
|
sheets, err := ImportXLSXFromFile("tmp.xlsx")
|
|
sheets, err := ImportXLSXFromFile("tmp.xlsx")
|
|
fmt.Println(sheets, "|", err)
|
|
fmt.Println(sheets, "|", err)
|