Test cases for version strings prefixed and suffixed by spaces and line feeds. GVU test coverage now 87.8% (up from 86.3%).
authorPeter Hosey <hg@boredzo.org>
Wed Oct 14 17:44:50 2009 -0700 (2009-10-14)
changeset 4521273618d372b1
parent 4520 ec1cf41d2ca4
child 4522 5fa478e3475a
Test cases for version strings prefixed and suffixed by spaces and line feeds. GVU test coverage now 87.8% (up from 86.3%).
Unit tests/TestVersionParsing.h
Unit tests/TestVersionParsing.m
     1.1 --- a/Unit tests/TestVersionParsing.h	Tue Oct 13 06:31:59 2009 -0700
     1.2 +++ b/Unit tests/TestVersionParsing.h	Wed Oct 14 17:44:50 2009 -0700
     1.3 @@ -26,4 +26,9 @@
     1.4  - (void) testParseWordFollowedByReleaseVersion;
     1.5  - (void) testParseReleaseVersionFollowedByWord;
     1.6  
     1.7 +- (void) testParseVersionStringPrefixedBySpaces;
     1.8 +- (void) testParseVersionStringPrefixedByLineFeed;
     1.9 +- (void) testParseVersionStringSuffixedBySpaces;
    1.10 +- (void) testParseVersionStringSuffixedByLineFeed;
    1.11 +
    1.12  @end
     2.1 --- a/Unit tests/TestVersionParsing.m	Tue Oct 13 06:31:59 2009 -0700
     2.2 +++ b/Unit tests/TestVersionParsing.m	Wed Oct 14 17:44:50 2009 -0700
     2.3 @@ -289,4 +289,25 @@
     2.4  	STAssertFalse(parseVersionString(string, &version), @"Successfully parsed a version followed by a word (%@) - this should have failed. Output version was %@", string, [NSMakeCollectable(createVersionDescription(version)) autorelease]);
     2.5  }
     2.6  
     2.7 +- (void) testParseVersionStringPrefixedBySpaces {
     2.8 +	struct Version version;
     2.9 +	NSString *string = @"  1.3.2b5";
    2.10 +	STAssertTrue(parseVersionString(string, &version), @"Could not parse a version string preceded by spaces");
    2.11 +}
    2.12 +- (void) testParseVersionStringPrefixedByLineFeed {
    2.13 +	struct Version version;
    2.14 +	NSString *string = @"\n1.3.2b5";
    2.15 +	STAssertTrue(parseVersionString(string, &version), @"Could not parse a version string preceded by a line feed");
    2.16 +}
    2.17 +- (void) testParseVersionStringSuffixedBySpaces {
    2.18 +	struct Version version;
    2.19 +	NSString *string = @"1.3.2b5  ";
    2.20 +	STAssertTrue(parseVersionString(string, &version), @"Could not parse a version string followed by spaces");
    2.21 +}
    2.22 +- (void) testParseVersionStringSuffixedByLineFeed {
    2.23 +	struct Version version;
    2.24 +	NSString *string = @"1.3.2b5\n";
    2.25 +	STAssertTrue(parseVersionString(string, &version), @"Could not parse a version string followed by a line feed");
    2.26 +}
    2.27 +
    2.28  @end