Skip to content

Commit

Permalink
Backfill a spec for empty (non null) c-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
tjarratt committed Jul 28, 2016
1 parent 7953ccd commit 3e1ad1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Spec/CDRTypeUtilitiesSpec.mm
Expand Up @@ -79,6 +79,11 @@
[CDRTypeUtilities boxedObjectOfBytes:(const void *)&text ofObjCType:@encode(const char *)] should equal(@"Hello world!");
});

it(@"should return a NSString for a non-null but empty c string", ^{
const char *text = "";
[CDRTypeUtilities boxedObjectOfBytes:(const void *)&text ofObjCType:@encode(const char *)] should equal(@"");
});

it(@"should return the objective-c object it was given", ^{
id foo = @"bar";
[CDRTypeUtilities boxedObjectOfBytes:(const void *)&foo ofObjCType:@encode(id)] should be_same_instance_as(foo);
Expand Down

0 comments on commit 3e1ad1d

Please sign in to comment.