Skip to content

Commit

Permalink
ASDimensionMake to be more lenient #trivial (#382)
Browse files Browse the repository at this point in the history
* ASDimensionMake to be more lenient

Don't throw assertion when the string is invalid

* Fix unit test
  • Loading branch information
nguyenhuy committed Jun 23, 2017
1 parent 992df78 commit df01adc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion Source/Layout/ASDimension.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ ASOVERLOADABLE ASDimension ASDimensionMake(NSString *dimension)
}
}

ASDisplayNodeCAssert(NO, @"Parsing dimension failed for: %@", dimension);
return ASDimensionAuto;
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/ASDimensionTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (void)testCreatingDimensionUnitAutos
{
XCTAssertNoThrow(ASDimensionMake(ASDimensionUnitAuto, 0));
XCTAssertThrows(ASDimensionMake(ASDimensionUnitAuto, 100));
XCTAssertThrows(ASDimensionMake(@""));
ASXCTAssertEqualDimensions(ASDimensionAuto, ASDimensionMake(@""));
ASXCTAssertEqualDimensions(ASDimensionAuto, ASDimensionMake(@"auto"));
}

Expand Down

0 comments on commit df01adc

Please sign in to comment.