package org.yaml.snakeyaml.resolver;

import junit.framework.TestCase;

public class RagelMachineTest extends TestCase {
    private RagelMachine machine = new RagelMachine();

    public void testScan() {
        assertNull(machine.scan("abc"));
    }

    public void testNullPointerException() {
        try {
            machine.scan(null);
            fail("null must not be accepted.");
        } catch (NullPointerException e) {
            assertEquals("Scalar must be provided", e.getMessage());
        }
    }

    public void testScanBoolean() {
        assertEquals("tag:yaml.org,2002:bool", machine.scan("true"));
    }
}

@@ -639,22 +639,1214 @@
 (%22true%22));%0D%0A
+        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22True%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22TRUE%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22false%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22False%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22FALSE%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22on%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22ON%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22On%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22off%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22Off%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22OFF%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22on%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22ON%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22On%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22off%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22Off%22));%0D%0A        assertEquals(%22tag:yaml.org,2002:bool%22, machine.scan(%22OFF%22));%0D%0A
     %7D%0D%0A%7D%0D%0A

test all bool values