forEachSwitchCase() matcher acting wierd,imho

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()).

HTH!

~Aaron

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
switchStmt(unless(has(compoundStmt(has(switchCase(unless(hasDescendant(breakStmt())))))))).

thank you both. this worked:
switchStmt(hasDescendant(compoundStmt(hasDescendant(switchCase(unless(hasDescendant(breakStmt())))))))