mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-01 08:45:09 +08:00
Add test coverage for ASTextNodeRenderer to validate nil and empty strings produce CGSizeZero
This commit is contained in:
@@ -69,6 +69,22 @@
|
||||
XCTAssertTrue(size.height > 0, @"Should have a nonzero height");
|
||||
}
|
||||
|
||||
- (void)testCalculateSizeWithEmptyString
|
||||
{
|
||||
_attributedString = [[NSAttributedString alloc] initWithString:@""];
|
||||
[self setUpRenderer];
|
||||
CGSize size = [_renderer size];
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeZero, size), @"Empty NSAttributedString should result in CGSizeZero");
|
||||
}
|
||||
|
||||
- (void)testCalculateSizeWithNilString
|
||||
{
|
||||
_attributedString = nil;
|
||||
[self setUpRenderer];
|
||||
CGSize size = [_renderer size];
|
||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeZero, size), @"Nil NSAttributedString should result in CGSizeZero");
|
||||
}
|
||||
|
||||
- (void)testNumberOfLines
|
||||
{
|
||||
[self setUpRenderer];
|
||||
|
||||
Reference in New Issue
Block a user