Skip to content

Commit

Permalink
Add a failing test for yaml issue #306
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 1, 2022
1 parent 20b7de3 commit 416461a
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.fasterxml.jackson.dataformat.yaml.failing;

import java.util.Collections;
import java.util.Map;

import com.fasterxml.jackson.dataformat.yaml.ModuleTestBase;
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;

// for [dataformats-text#306]
public class NameQuoting306Test extends ModuleTestBase
{
private final YAMLMapper MAPPER = newObjectMapper();

// for [dataformats-text#306]
public void testComplexName() throws Exception
{
final String key = "SomeKey:\nOtherLine";
Map<?,?> input = Collections.singletonMap(key, 302);
final String doc = MAPPER.writeValueAsString(input);
Map<?,?> actual = MAPPER.readValue(doc, Map.class);
assertEquals(input, actual);
}
}

0 comments on commit 416461a

Please sign in to comment.