Fixes #222: Long version ids (12 digits based on reverse date) cause update to work no longer

This commit is contained in:
Andy Matuschak committed 2012-11-15 22:49:55 -08:00
1 parent b86770c39f
commit 7b3928db9b
2 files changed
+11 -6

No files matched your search

+6 -6
View File
@@ -84,8 +84,8 @@ typedef enum {
NSArray *partsB = [self splitVersionString:versionB];
NSString *partA, *partB;
NSUInteger i, n;
int intA, intB;
int i, n;
long long valueA, valueB;
SUCharacterType typeA, typeB;
n = MIN([partsA count], [partsB count]);
@@ -100,11 +100,11 @@ typedef enum {
if (typeA == typeB) {
// Same type; we can compare
if (typeA == kNumberType) {
intA = [partA intValue];
intB = [partB intValue];
if (intA > intB) {
valueA = [partA longLongValue];
valueB = [partB longLongValue];
if (valueA > valueB) {
return NSOrderedDescending;
} else if (intA < intB) {
} else if (valueA < valueB) {
return NSOrderedAscending;
}
} else if (typeA == kStringType) {
+5
View File
@@ -59,4 +59,9 @@
// SUAssertEqual(@"1.0 - beta", @"1.0 beta");
}
- (void)testVersionsWithReverseDateBasedNumbers
{
SUAssertAscending(@"201210251627", @"201211051041");
}
@end