drawing_test.go 1.0 KB

123456789101112131415161718192021222324252627
  1. // Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
  2. // this source code is governed by a BSD-style license that can be found in
  3. // the LICENSE file.
  4. //
  5. // Package excelize providing a set of functions that allow you to write to
  6. // and read from XLSX files. Support reads and writes XLSX file generated by
  7. // Microsoft Excel™ 2007 and later. Support save file without losing original
  8. // charts of XLSX. This library needs Go version 1.10 or later.
  9. package excelize
  10. import (
  11. "testing"
  12. )
  13. func TestDrawingParser(t *testing.T) {
  14. f := File{
  15. Drawings: make(map[string]*xlsxWsDr),
  16. XLSX: map[string][]byte{
  17. "charset": MacintoshCyrillicCharset,
  18. "wsDr": []byte(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><xdr:wsDr xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"><xdr:oneCellAnchor><xdr:graphicFrame/></xdr:oneCellAnchor></xdr:wsDr>`)},
  19. }
  20. // Test with one cell anchor
  21. f.drawingParser("wsDr")
  22. // Test with unsupport charset
  23. f.drawingParser("charset")
  24. }