#! /bin/java bsh.Interpreter
// Submitted by d-esterkin

source("TestHarness.bsh");

/* A valid statement should return null */
e1 = ParserTester.eval("x = 2 + 2;");
assert(e1 == null);

/* An invalid statement should return a ParseException */
e2 = ParserTester.eval("x = 2 + ;");
assert(e2 instanceof bsh.ParseException);

t = null;
if (e2 instanceof bsh.ParseException) {
    t = ((bsh.ParseException) e2).currentToken;
    assert(t != null);
}

if (t != null) {
    pe = (bsh.ParseException) e2;
    assert(1 == pe.getErrorLineNumber());
    assert(null != pe.getErrorText());
}

complete();
