Luke Bayes wrote:
...
> Actually, I believe that the Flash IDE does not complete the
> compilation of your .swf file if there is a significant exception.
I don't get this. How is the compiler going to track we're having a
runtime exception? ( Things like: throw new Error ("could not connect to
server");)
> The process of Unit Testing requires that you get a good compile
> first. Unit testing is designed to test the "functionality" of a small
> chunk of code. If there are "syntax" or "structural" errors, the
> compiler is supposed to catch those first. These other, higher-level
> errors should be fixed before continuing with another Unit Test.
>
> To answer your question specifically, yes - you are seeing the desired
> behavior, and no - it's not a bug, it's a feature. ;-)
I doubt whether it is really "desired": e.g. JUnit fails the test when
an uncaught exception occurs. I know MacroMedia's implementation of an
exception rippling through to the top layer is quite awkward, but
skipping of a test due to this is unacceptable. Suppose one of your
collegues changed the behaviour of an underlying function so it throws
an exception in some cases. He'll never know if he screwed up, because
he won't get any red when running the tests!
Anyway, for now, I'll write all my tests as folows:
try{
...
}catch (e:Object{
fail();
}
Kind regards,
Bert Bruynooghe.
|