@Test
    public void testInputErrors() {
        String message = "";
        try {
            parser = new DegreesParser("N90;S90");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("found latitude (N or S) twice", message);
        try {
            parser = new DegreesParser("E120;W120");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("found longitude (E or W) twice", message);
        try {
            parser = new DegreesParser("N90;90");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("end of field without any compass direction seen", message);
        try {
            parser = new DegreesParser("N90;E");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("end of field without any number seen", message);
        try {
            parser = new DegreesParser(";");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("end of field without any compass direction seen", message);
        try {
            parser = new DegreesParser("25;60");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("end of field without any compass direction seen", message);
        try {
            parser = new DegreesParser("NW25;SW60");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("already set direction once, cannot add direction: W", message);
        try {
            parser = new DegreesParser("N16.25\u00B0;W60");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("cannot have fractional degrees before degrees sign", message);
        try {
            parser = new DegreesParser("N16\u00B022.40';W60");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("cannot have fractional minutes before minutes sign", message);
        try {
            parser = new DegreesParser("");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("end of field without any compass direction seen", message);
        try {
            parser = new DegreesParser("Yahoo!");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("invalid character: Y", message);
        try {
            parser = new DegreesParser("N63O025.105;E010O25.982");
        } catch (IllegalArgumentException e) {
            message = e.getMessage();
        }
        assertEquals("invalid character: O", message);
    }
Tests various inputs that contain syntax errors.
vespajlib/src/test/java/com/yahoo/geo/DegreesParserTestCase.java