@@ -0,0 +1,2116 @@
+/**%0A * Copyright (c) 2008-2013, http://www.snakeyaml.org%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.yaml.snakeyaml.issues.issue173;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport org.yaml.snakeyaml.DumperOptions;%0Aimport org.yaml.snakeyaml.Yaml;%0Aimport org.yaml.snakeyaml.representer.Representer;%0A%0Apublic class RecursiveAnchorTest extends TestCase %7B%0A%0A    public void testWithoutCustomStyle() throws Exception %7B%0A        Map%3CString, Map%3CString, Object%3E%3E rootMap = new HashMap%3CString, Map%3CString, Object%3E%3E();%0A        Map%3CString, Object%3E enclosedMap = new HashMap%3CString, Object%3E();%0A        enclosedMap.put(%22world%22, %22test%22);%0A        rootMap.put(%22test%22, enclosedMap);%0A        Yaml yaml = new Yaml();%0A        String output = yaml.dump(rootMap);%0A        assertEquals(%22test: %7Bworld: test%7D%5Cn%22, output);%0A    %7D%0A%0A    public void testWithBlockStyle() throws Exception %7B%0A        Map%3CString, Map%3CString, Object%3E%3E rootMap = new HashMap%3CString, Map%3CString, Object%3E%3E();%0A        Map%3CString, Object%3E enclosedMap = new HashMap%3CString, Object%3E();%0A        enclosedMap.put(%22world%22, %22test%22);%0A        rootMap.put(%22test%22, enclosedMap);%0A%0A        DumperOptions yamlOptions = new DumperOptions();%0A        yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);%0A%0A        Representer yamlRepresenter = new Representer();%0A        yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);%0A%0A        Yaml yaml = new Yaml(yamlRepresenter, yamlOptions);%0A        String output = yaml.dump(rootMap);%0A        assertEquals(%22test:%5Cn  world: test%5Cn%22, output);%0A    %7D%0A%7D%0A

Add a test for issue 173