/**
 * Copyright (c) 2008-2010, http://www.snakeyaml.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.yaml.snakeyaml;

import junit.framework.TestCase;

public class YamlTest extends TestCase {

    public void testSetNoName() {
        Yaml yaml = new Yaml();
        assertTrue(yaml.toString().matches("Yaml:\\d+"));
    }

    public void testSetName() {
        Yaml yaml = new Yaml();
        yaml.setName("REST");
        assertEquals("REST", yaml.getName());
        assertEquals("REST", yaml.toString());
    }
}

@@ -660,16 +660,46 @@
 aml;%0D%0A%0D%0A
+import java.util.Iterator;%0D%0A%0D%0A
 import j
@@ -1104,12 +1104,717 @@
 %0D%0A    %7D%0D
+%0A%0D%0A    /**%0D%0A     * Check that documents are parsed only when they are asked to be loaded.%0D%0A     */%0D%0A    public void testOneDocument() %7B%0D%0A        Yaml yaml = new Yaml();%0D%0A        String doc = %22--- a%5Cn--- %5B:%5D%22;%0D%0A        Iterator%3CObject%3E loaded = yaml.loadAll(doc).iterator();%0D%0A        assertTrue(loaded.hasNext());%0D%0A        Object obj1 = loaded.next();%0D%0A        assertEquals(%22a%22, obj1);%0D%0A        assertTrue(loaded.hasNext());%0D%0A        try %7B%0D%0A            loaded.next();%0D%0A            fail(%22Second document is invalid%22);%0D%0A        %7D catch (Exception e) %7B%0D%0A            assertEquals(%22while parsing a flow node; expected the node content, but found Value%22, e%0D%0A                    .getMessage());%0D%0A        %7D%0D%0A    %7D%0D
 %0A%7D%0D%0A

Add test: check that documents are parsed only when they are asked to be loaded