Skip to content

Commit

Permalink
Merge branch '2.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 25, 2023
2 parents 01305c8 + 3fea69f commit c50aa21
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import java.util.Collections;

import tools.jackson.dataformat.yaml.ModuleTestBase;
import tools.jackson.dataformat.yaml.YAMLFactory;
import tools.jackson.dataformat.yaml.YAMLGenerator;
import tools.jackson.dataformat.yaml.YAMLMapper;

// NOTE: fails only on 2.x (2.12) -- fixed for 3.0
public class SimpleGeneration215Test extends ModuleTestBase
{
// [dataformats-text#215]: setting used in constructor
// [dataformats-text#215]
public void testStartMarkerViaWriter() throws Exception
{
final String output = YAMLMapper.builder().build()
Expand All @@ -19,4 +20,15 @@ public void testStartMarkerViaWriter() throws Exception
.trim();
assertEquals("key: \"value\"", output);
}

// [dataformats-text#215]
public void testStartMarkerViaMapper() throws Exception
{
YAMLMapper mapper = new YAMLMapper(YAMLFactory.builder()
.disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER).build()
);
final String output = mapper.writeValueAsString(Collections.singletonMap("key", "value"))
.trim();
assertEquals("key: \"value\"", output);
}
}

0 comments on commit c50aa21

Please sign in to comment.