Skip to content

Commit f779ea9

Browse files
committed
Add a passing test wrt #492
1 parent d076aab commit f779ea9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

yaml/src/test/java/com/fasterxml/jackson/dataformat/yaml/ser/GeneratorWithMinimizeTest.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public void testNumberKey() throws Exception
264264
// [dataformats-text#246]
265265
public void testMinimizeQuotesSpecialCharsMultiLine() throws Exception
266266
{
267-
Map<String, Object> content = new HashMap<String, Object>();
267+
Map<String, Object> content = new HashMap<>();
268268
content.put("key", "first\nsecond: third");
269269
String yaml = MINIM_MAPPER.writeValueAsString(content).trim();
270270

@@ -277,7 +277,7 @@ public void testMinimizeQuotesSpecialCharsMultiLine() throws Exception
277277
// in minimized mode
278278
public void testQuotingOfTilde() throws Exception
279279
{
280-
Map<String, Object> content = new HashMap<String, Object>();
280+
Map<String, Object> content = new HashMap<>();
281281
content.put("key", "~");
282282

283283
assertEquals("---\n" +
@@ -288,4 +288,17 @@ public void testQuotingOfTilde() throws Exception
288288
"key: \"~\"",
289289
MINIM_MAPPER.writeValueAsString(content).trim());
290290
}
291+
292+
// [dataformats-text#492]: too aggressive dropping of quoting?
293+
// (wrt [dataformats-text#465] change in 2.17)
294+
public void testMinimalHashQuoting492() throws Exception
295+
{
296+
Map<String, String> content = Collections.singletonMap("$ref",
297+
"core-api.yaml#/components/responses/ClientError");
298+
String yaml = MINIM_MAPPER.writeValueAsString(content);
299+
300+
Map<?, ?> result = MINIM_MAPPER.readValue(yaml, Map.class);
301+
302+
assertEquals(content, result);
303+
}
291304
}

0 commit comments

Comments
 (0)