[Pyobjc-dev] Re: Odd testcase
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2004-02-22 01:31:55
|
On Feb 21, 2004, at 12:01 PM, Ronald Oussoren wrote: > a = objc.runtime.NSMutableArray.array() > a.addObject_(o) > b = objc.runtime.NSMutableArray.arrayWithObject_("m") > self.assertEquals(a.valueForKey_("keyM"), b) > > self.assertRaises(KeyError, getKey, o, "nokey") > > I don't understand the last part of the testcase, why does > "self.assertEquals(a.valueForKey_("keyM"), b)" succeed on OS X 10.3. > It fails on OS X 10.2 and GNUstep, and that is what I would expect. 10.2 and GNUstep are broken, then. :-) Seriously, I *believe* this should work as written on Jaguar. a = objc.runtime.NSMutableArray.array() a.addObject_(o) The assertEquals() is checking to see if valueForKey() is returning an array of values when invoked upon an array of objects. b is just an array of the expected values. That is only one item is because whoever wrote the test [me] was lazy. b.bum |