testing exception output matches expected output