package org.yaml.snakeyaml;

import junit.framework.TestCase;

import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;

public class DumperOptionsTest extends TestCase {

    public void testDefaultStyle() {
        DumperOptions options = new DumperOptions();
        Yaml yaml = new Yaml(options);
        assertEquals("'123'\n", yaml.dump("123"));
        //
        options.setDefaultStyle('\"');
        yaml = new Yaml(options);
        assertEquals("\"123\"\n", yaml.dump("123"));
        //
        options.setDefaultStyle('\'');
        yaml = new Yaml(options);
        assertEquals("'123'\n", yaml.dump("123"));
        //
        options.setDefaultStyle(null);
        yaml = new Yaml(options);
        assertEquals("'123'\n", yaml.dump("123"));
    }
}

@@ -34,105 +34,138 @@
 rt j
-unit.framework.TestCase;%0A%0Aimport org.yaml.snakeyaml.DumperOptions;%0Aimport org.yaml.snakeyaml.Yaml
+ava.util.LinkedHashMap;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport junit.framework.TestCase
 ;%0A%0Ap
@@ -806,11 +806,1516 @@
 );%0A    %7D
+%0A%0A    public void testDefaultFlowStyle() %7B%0A        Yaml yaml = new Yaml();%0A        List%3CInteger%3E list = new LinkedList%3CInteger%3E();%0A        list.add(1);%0A        list.add(2);%0A        list.add(3);%0A        assertEquals(%22%5B1, 2, 3%5D%5Cn%22, yaml.dump(list));%0A        //%0A        DumperOptions options = new DumperOptions();%0A        options = new DumperOptions();%0A        options.setDefaultFlowStyle(true);%0A        yaml = new Yaml(options);%0A        assertEquals(%22%5B1, 2, 3%5D%5Cn%22, yaml.dump(list));%0A        //%0A        options = new DumperOptions();%0A        options.setDefaultFlowStyle(false);%0A        yaml = new Yaml(options);%0A        assertEquals(%22- 1%5Cn- 2%5Cn- 3%5Cn%22, yaml.dump(list));%0A    %7D%0A%0A    public void testDefaultFlowStyleNested() %7B%0A        Yaml yaml = new Yaml();%0A        List%3CInteger%3E list = new LinkedList%3CInteger%3E();%0A        list.add(1);%0A        list.add(2);%0A        list.add(3);%0A        Map%3CString, Object%3E map = new LinkedHashMap%3CString, Object%3E();%0A        map.put(%22a%22, %22b%22);%0A        map.put(%22c%22, list);%0A        assertEquals(%22a: b%5Cnc: %5B1, 2, 3%5D%5Cn%22, yaml.dump(map));%0A        //%0A        DumperOptions options = new DumperOptions();%0A        options = new DumperOptions();%0A        options.setDefaultFlowStyle(true);%0A        yaml = new Yaml(options);%0A        assertEquals(%22%7Ba: b, c: %5B1, 2, 3%5D%7D%5Cn%22, yaml.dump(map));%0A        //%0A        options = new DumperOptions();%0A        options.setDefaultFlowStyle(false);%0A        yaml = new Yaml(options);%0A        assertEquals(%22a: b%5Cnc:%5Cn- 1%5Cn- 2%5Cn- 3%5Cn%22, yaml.dump(map));%0A    %7D
 %0A%7D%0A

add testDefaultFlowStyle