drawing_test.go 1.1 KB
Newer Older
1
// Copyright 2016 - 2022 The excelize Authors. All rights reserved. Use of
2 3 4 5
// this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
//
// Package excelize providing a set of functions that allow you to write to
xurime's avatar
xurime 已提交
6 7 8 9
// and read from XLSX / XLSM / XLTM files. Supports reading and writing
// spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports
// complex components by high compatibility, and provided streaming API for
// generating or reading data from a worksheet with huge amounts of data. This
10
// library needs Go version 1.15 or later.
11 12 13 14

package excelize

import (
15
	"sync"
16 17 18 19 20
	"testing"
)

func TestDrawingParser(t *testing.T) {
	f := File{
21
		Drawings: sync.Map{},
22
		Pkg:      sync.Map{},
23
	}
24 25
	f.Pkg.Store("charset", MacintoshCyrillicCharset)
	f.Pkg.Store("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>`))
26 27
	// Test with one cell anchor
	f.drawingParser("wsDr")
xurime's avatar
xurime 已提交
28
	// Test with unsupported charset
29 30
	f.drawingParser("charset")
}