Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gomutex committed Feb 8, 2024
1 parent 990a831 commit 4b0739c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions oxml/elements/text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ func TestTextMarshalXML(t *testing.T) {
input *Text
expected string
}{
{NewText(), `<w:t></w:t>`},
{TextFromString("Hello, World!"), `<w:t>Hello, World!</w:t>`},
{NewText(), `<w:t xml:space="preserve"></w:t>`},
{TextFromString("Hello, World!"), `<w:t xml:space="preserve">Hello, World!</w:t>`},
}

for _, tc := range testCases {
Expand Down Expand Up @@ -43,9 +43,9 @@ func TestTextUnmarshalXML(t *testing.T) {
input string
expected *Text
}{
{`<w:t></w:t>`, NewText()},
{`<w:t>Hello, World!</w:t>`, TextFromString("Hello, World!")},
{`<w:t>Some text</w:t><w:other>Other element</w:other>`, TextFromString("Some text")},
{`<w:t xml:space="preserve"></w:t>`, NewText()},
{`<w:t xml:space="preserve">Hello, World!</w:t>`, TextFromString("Hello, World!")},
{`<w:t xml:space="preserve">Some text</w:t><w:other>Other element</w:other>`, TextFromString("Some text")},
}

for _, tc := range testCases {
Expand Down

0 comments on commit 4b0739c

Please sign in to comment.