MCPcopy
hub / github.com/qax-os/excelize / TestGetRootElement

Function TestGetRootElement

lib_test.go:290–296  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

288}
289
290func TestGetRootElement(t *testing.T) {
291 assert.Len(t, getRootElement(xml.NewDecoder(strings.NewReader(""))), 0)
292 // Test get workbook root element which all workbook XML namespace has prefix
293 f := NewFile()
294 d := f.xmlNewDecoder(bytes.NewReader([]byte(`<x:workbook xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"></x:workbook>`)))
295 assert.Len(t, getRootElement(d), 3)
296}
297
298func TestSetIgnorableNameSpace(t *testing.T) {
299 f := NewFile()

Callers

nothing calls this directly

Calls 4

xmlNewDecoderMethod · 0.95
getRootElementFunction · 0.85
NewFileFunction · 0.85
LenMethod · 0.80

Tested by

no test coverage detected