Skip to content

Commit

Permalink
Set the default line length to infinity (-1) (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed May 6, 2020
1 parent 53403b5 commit 0b1645d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions apic.go
Expand Up @@ -86,6 +86,7 @@ func yaml_emitter_initialize(emitter *yaml_emitter_t) {
raw_buffer: make([]byte, 0, output_raw_buffer_size),
states: make([]yaml_emitter_state_t, 0, initial_stack_size),
events: make([]yaml_event_t, 0, initial_queue_size),
best_width: -1,
}
}

Expand Down
5 changes: 5 additions & 0 deletions encode_test.go
Expand Up @@ -397,6 +397,11 @@ var marshalTests = []struct {
map[string]interface{}{"a": jsonNumberT("bogus")},
"a: bogus\n",
},
// Ensure that strings do not wrap
{
map[string]string{"a": "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 "},
"a: 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 '\n",
},
}

func (s *S) TestMarshal(c *C) {
Expand Down

0 comments on commit 0b1645d

Please sign in to comment.