here's the tst function:
forEachSwitchCase() is something that checks each case label in a
switch statement against the argument to the matcher. This explains
why you match one out of the three case labels -- each one is checked
individually against hasDescendant(breakStmt()).
forEachSwichCase allows the matcher to match multiple times if there
are multiple switch cases that match.
It doesn't prevent a match if there is a switch case that doesn't match.
To match switch statements where all switch cases have a break
statement you should be able to use
thank you both. this worked: