diff options
author | Max <post@wickenrode.com> | 2015-01-28 22:42:47 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-01-28 22:42:47 +0100 |
commit | 2ab2ddf5356117d16d1b0e9f78f9c74b6fdb2dc1 (patch) | |
tree | 2bd6faf819696b0e987145245954c95c402deee9 /UnitTests | |
parent | aa15d317223cc0d1f0d3267728132b7bdbf238df (diff) | |
download | sequelpro-2ab2ddf5356117d16d1b0e9f78f9c74b6fdb2dc1.tar.gz sequelpro-2ab2ddf5356117d16d1b0e9f78f9c74b6fdb2dc1.tar.bz2 sequelpro-2ab2ddf5356117d16d1b0e9f78f9c74b6fdb2dc1.zip |
Fix syntax highlighting for emoji et al. #2044
Voodoo magic provided by @Bibiko ;)
Diffstat (limited to 'UnitTests')
-rw-r--r-- | UnitTests/SPParserUtilsTest.m | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/UnitTests/SPParserUtilsTest.m b/UnitTests/SPParserUtilsTest.m index 5066f8f7..994b166a 100644 --- a/UnitTests/SPParserUtilsTest.m +++ b/UnitTests/SPParserUtilsTest.m @@ -44,6 +44,9 @@ @implementation SPParserUtilsTest - (void)testUtf8strlen { + // NOTE!!: Those test do not verify that the utf8strlen() function works according to spec, + // but whether it produces the same results as NSString for the same input. + const char *empty = ""; NSString *emptyString = [NSString stringWithCString:empty encoding:NSUTF8StringEncoding]; STAssertEquals(utf8strlen(empty),[emptyString length], @"empty string"); @@ -52,8 +55,8 @@ // If any of those conditions fail, all of the following assumptions are moot. const char *charSeq = "\xF0\x9F\x8D\x8F"; //🍏 NSString *charString = [NSString stringWithCString:charSeq encoding:NSUTF8StringEncoding]; - STAssertEquals(strlen(charSeq), 4, @"assumption about storage for binary C string"); - STAssertEquals([charString length], 2, @"assumption about NSString internal storage of string"); + STAssertEquals(strlen(charSeq), (size_t)4, @"assumption about storage for binary C string"); + STAssertEquals([charString length], (NSUInteger)2, @"assumption about NSString internal storage of string"); const char *singleByteSeq = "Hello World!"; NSString *singleByteString = [NSString stringWithCString:singleByteSeq encoding:NSUTF8StringEncoding]; |