Skip to content

Commit 416461a

Browse files
committed
Add a failing test for yaml issue #306
1 parent 20b7de3 commit 416461a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.fasterxml.jackson.dataformat.yaml.failing;
2+
3+
import java.util.Collections;
4+
import java.util.Map;
5+
6+
import com.fasterxml.jackson.dataformat.yaml.ModuleTestBase;
7+
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
8+
9+
// for [dataformats-text#306]
10+
public class NameQuoting306Test extends ModuleTestBase
11+
{
12+
private final YAMLMapper MAPPER = newObjectMapper();
13+
14+
// for [dataformats-text#306]
15+
public void testComplexName() throws Exception
16+
{
17+
final String key = "SomeKey:\nOtherLine";
18+
Map<?,?> input = Collections.singletonMap(key, 302);
19+
final String doc = MAPPER.writeValueAsString(input);
20+
Map<?,?> actual = MAPPER.readValue(doc, Map.class);
21+
assertEquals(input, actual);
22+
}
23+
}

0 commit comments

Comments
 (0)