Re: Determining if NSArray/NSDictionary is immutable
Re: Determining if NSArray/NSDictionary is immutable
- Subject: Re: Determining if NSArray/NSDictionary is immutable
- From: Douglas Davidson <email@hidden>
- Date: Sat, 9 Jul 2005 12:41:05 -0700
On Jul 8, 2005, at 8:08 PM, email@hidden wrote:
And to cut a riposte off at the pass, I'm not interested in arguing
about the language semantics and theorising subtleties - in my
particular case I'm writing testers for code which I think really
should be returning mutable or immutable instances strictly, so
simply saying "it says it returns NSDictionary, so just don't
mutate it" isn't a good enough answer.
If that is the standard against which you are testing, then I would
suggest trying to mutate the object and catching the resulting
exception. That would seem to be the actual crux of the matter being
tested--that an exception should be thrown on invalid operations. A
complete test suite will of course test that exceptions are thrown
when they are required.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden