I have written a simple test for binary expression type errorchecking. This test should yield two errors, since both a and b are integers and the operator requires two boolean operators.

test boolean op with int [[

public int calc() {
	int a;
	int b;			
	return a && b; 
}

]] 2 errors

Two error messages are shown (see below), one on node a and one on node b (both are underlined in red), but still the testcase fails. When I change the number of expected errors to 1, the test succeeds. How can it be that two error messages give just one error?

Multiple messages:

  • Expression is of type int instead of type
    boolean
    • Expression is of type int instead of type
      boolean
Submitted on 1 December 2011 at 15:46

On 9 December 2011 at 11:08 Guido Wachsmuth commented:

The typical reason for this is a nested list of errors. Probably you have a rule for editor-error which returns a list of two errors. This list is then collected into the list of all errors. Since your two errors are the only errors, you will get a list of a list of two errors. I assume the testing language simply counts the entries in the outer list, yielding one in this case. A simple solution is to flatten the list of errors in your editor-analyse.


On 9 December 2011 at 11:08 Guido Wachsmuth tagged pitfall

On 9 December 2011 at 11:08 Guido Wachsmuth tagged lab

On 9 December 2011 at 11:14 Lennart Kats commented:

This should be fixed in more recent revisions, where the testing language applies the flatten-list itself.


On 2 February 2012 at 16:33 Lennart Kats closed this issue.

On 2 February 2012 at 16:33 Lennart Kats commented:

This was fixed in 1.0.1.


On 2 February 2012 at 16:33 Lennart Kats tagged 1.0

Log in to post comments