Skip to content

Commit

Permalink
Test updates for new WriteFormattedComment method
Browse files Browse the repository at this point in the history
  • Loading branch information
arvindth committed Aug 6, 2019
1 parent 8ca4fbe commit be36114
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ func TestMustSet(t *testing.T) {
func TestWrite(t *testing.T) {
for _, test := range writeTests {
p, err := parse(test.input, false)
assert.Equal(t, err, nil)

buf := new(bytes.Buffer)
var n int
Expand All @@ -903,6 +904,7 @@ func TestWrite(t *testing.T) {
func TestWriteComment(t *testing.T) {
for _, test := range writeCommentTests {
p, err := parse(test.input, false)
assert.Equal(t, err, nil)

buf := new(bytes.Buffer)
var n int
Expand All @@ -922,14 +924,15 @@ func TestWriteComment(t *testing.T) {
func TestWriteCommentWithFormatting(t *testing.T) {
for _, test := range writeCommentWithFormattingTests {
p, err := parse(test.input, true)
assert.Equal(t, err, nil)

buf := new(bytes.Buffer)
var n int
switch test.encoding {
case "UTF-8":
n, err = p.WriteCommentWithFormatting(buf, "", UTF8, true)
n, err = p.WriteFormattedComment(buf, UTF8)
case "ISO-8859-1":
n, err = p.WriteCommentWithFormatting(buf, "", ISO_8859_1, true)
n, err = p.WriteFormattedComment(buf, ISO_8859_1)
}
assert.Equal(t, err, nil)
s := string(buf.Bytes())
Expand All @@ -942,6 +945,7 @@ func TestWriteCommentWithFormatting(t *testing.T) {
func TestWriteFormattedCommentWithoutFormatting(t *testing.T) {
for _, test := range writeFormattedCommentWithoutFormattingTests {
p, err := parse(test.input, true)
assert.Equal(t, err, nil)

buf := new(bytes.Buffer)
var n int
Expand Down

0 comments on commit be36114

Please sign in to comment.