Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed FBSnapshotTestCaseDefaultSuffixes to return the correct suffixes based on the architecture. #87

Merged
merged 2 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions FBSnapshotTestCase/FBSnapshotTestCasePlatform.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ BOOL FBSnapshotTestCaseIs64Bit(void)

NSOrderedSet *FBSnapshotTestCaseDefaultSuffixes(void)
{
NSMutableOrderedSet *suffixesSet = [[NSMutableOrderedSet alloc] init];
[suffixesSet addObject:@"_32"];
[suffixesSet addObject:@"_64"];
if (FBSnapshotTestCaseIs64Bit()) {
return [suffixesSet reversedOrderedSet];
return [NSOrderedSet orderedSetWithObject:@"_64"];
} else {
return [NSOrderedSet orderedSetWithObject:@"_32"];
}
return [suffixesSet copy];
}

NSString *FBFileNameIncludeNormalizedFileNameFromOption(NSString *fileName, FBSnapshotTestCaseFileNameIncludeOption option)
Expand All @@ -54,7 +52,7 @@ BOOL FBSnapshotTestCaseIs64Bit(void)
[invalidCharacters formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]];
NSArray *validComponents = [fileName componentsSeparatedByCharactersInSet:invalidCharacters];
fileName = [validComponents componentsJoinedByString:@"_"];

if ((option & FBSnapshotTestCaseFileNameIncludeOptionScreenScale) == FBSnapshotTestCaseFileNameIncludeOptionScreenScale) {
CGFloat screenScale = [[UIScreen mainScreen] scale];
fileName = [fileName stringByAppendingFormat:@"@%.fx", screenScale];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,4 @@ - (void)testViewSnapshotWithDifferentBackgroundColorPerArchitecture
FBSnapshotVerifyView(view, nil);
}

- (void)testViewSnapshotRecordedOnlyFor64BitArchitecture
{
UIView *greenView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
greenView.backgroundColor = [UIColor greenColor];
FBSnapshotVerifyView(greenView, nil);
}

@end
Binary file not shown.
Binary file not shown.