1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.yaml.snakeyaml.issues.issue51;
18
19 import java.io.IOException;
20
21 import junit.framework.TestCase;
22
23 import org.yaml.snakeyaml.DumperOptions;
24 import org.yaml.snakeyaml.DumperOptions.ScalarStyle;
25 import org.yaml.snakeyaml.Yaml;
26
27
28
29
30
31 public class UnicodeStyleTest extends TestCase {
32 public void testFoldedStyle() throws IOException {
33 Yaml yaml = new Yaml();
34 String output = yaml.dump("í");
35
36 assertEquals("í\n", output);
37 }
38
39 public void testDoubleQuotedStyle() throws IOException {
40 DumperOptions options = new DumperOptions();
41 options.setDefaultScalarStyle(ScalarStyle.DOUBLE_QUOTED);
42 Yaml yaml = new Yaml(options);
43 String output = yaml.dump("í");
44
45 assertEquals("\"í\"\n", output);
46 }
47 }