From 290ea97f2ea7a621b7ebea3a9152933366a5d253 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Fri, 24 Jan 2020 14:21:28 -0800 Subject: [PATCH] set the default line length to infinity (-1) --- apic.go | 1 + encode_test.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/apic.go b/apic.go index 1f7e87e6..d2c2308f 100644 --- a/apic.go +++ b/apic.go @@ -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, } } diff --git a/encode_test.go b/encode_test.go index 4a266008..f7c91ff0 100644 --- a/encode_test.go +++ b/encode_test.go @@ -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) {