in reply to Re: given/when one case prefixes another
in thread given/when one case prefixes another
It seems like perfectly fine code to me.
I guess you are wondering if the code directly in "given" (without a "when" clause) is "proper". The answer is yes. That's one feature that distinguishes given/when from the switch statement in C.
But do consider that such code could become hard to read if the whole given/when doesn't fit onto one or two screen pages anymore - you shouldn't be doing very much in the when clauses (calling functions or methods should be fine).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: given/when one case prefixes another
by AnomalousMonk (Archbishop) on Apr 26, 2011 at 15:46 UTC |