I’m spending too much time trying to figure out how to assert that a string is properly URL encoded! I refuse to take the traditional approach of running code in the application and peeking through debugger goggles or some obscure log output. Unit tests are made for this sorta thing! I’e had some tips that suggest how to perform URL encoding but experience teaches me not to trust any particular tip unless I can confirm it in a learning unit test. That’s how I self-educated myself on Ruby over the weekend. I wrote a bunch of learning tests to confirm every code snippet I read online. So why is it that when I assert @”ab%%c” == @”ab c” the error message echoes back “ab != ab c”??? I’m using Google tools for Mac to run iPhone unit test suites.
One other thing… could somebody please invent/has somebody invented an “automatic add new files to svn” plugin for XCode? If I botch one more commit my team is going to cut off my water supply and replace my contact lens solution with Windsor’s clear hot sauce. I love the clear stuff because I can dump a whole bunch on my meal without my wife nagging me about my heartburn.

When comparing strings in Objective-C, you should use the -[NSString isEqualToString:] methods instead of ==. Why %% doesn’t get converted to %? I have no idea…
By: guenthernoack on November 5, 2008
at 8:31 am
Err, %% obviously doesn’t get converted to %… My fault. %-) What I don’t know is why it gets converted to a space…
By: guenthernoack on November 5, 2008
at 8:34 am
My mistake! The error returned actually says “ab@c != ab c” and the @ is an apple in my output. (It’s hard to represent the problem in a text area while commenting from an iPhone.) The point, my assertion failure gives no indication of what’s in the string.
By: Cliff on November 5, 2008
at 8:49 am