#!/bin/java bsh.Interpreter

import Exceptions;

source("TestHarness.bsh");

// Catch a checked exception
try { new FileInputStream("/tmp/aksljdflkasd");
} catch ( e ) {
	print(e); flag();
}

// Catch an unchecked exception
try { Exceptions.throwArithmetic();
} catch ( e ) {
	print(e); flag();
}
// Catch an unchecked exception
try { Exceptions.throwRuntime();
} catch ( e ) {
	print(e); flag();
}

// Catch a checked exception
try { Exceptions.throwException();
} catch ( e2 ) {
	print(e2); flag();
}

foo() {
	try { int i=1/0; } catch ( ArithmeticException e ) { flag(); }
}

foo();

assert( flag() == 5 );

complete();
