diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-29 12:56:01 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-03-30 03:29:44 -0700 |
commit | de077bd3ccf757b4c888e79b445c6dad80564bfa (patch) | |
tree | be2df93253c21475146e44a2e02056a9528205c1 | |
parent | 06e38407d24ce6bd9cf46b04c7d3d7b74c56f94a (diff) | |
download | qtlocation-mapboxgl-de077bd3ccf757b4c888e79b445c6dad80564bfa.tar.gz |
[ios, macos] Updated tests for aftermarket expressions
-rw-r--r-- | platform/darwin/test/MGLExpressionTests.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/darwin/test/MGLExpressionTests.mm b/platform/darwin/test/MGLExpressionTests.mm index 97b3548db4..35f97326c6 100644 --- a/platform/darwin/test/MGLExpressionTests.mm +++ b/platform/darwin/test/MGLExpressionTests.mm @@ -568,7 +568,8 @@ using namespace std::string_literals; // NSExpression is unable to evaluate NSNumber’s -floatValue, // -doubleValue, or -decimalValue by themselves because they each return // a primitive instead of an object. - XCTAssertEqualObjects([NSExpression mgl_expressionWithJSONObject:jsonExpression], expression); + XCTAssertEqualObjects([NSExpression mgl_expressionWithJSONObject:jsonExpression], + [NSExpression expressionWithFormat:@"CAST(postalCode, 'NSNumber')"]); } { NSExpression *expression = [NSExpression expressionWithFormat:@"FUNCTION(postalCode, 'mgl_numberWithFallbackValues:', zipCode)"]; @@ -638,7 +639,7 @@ using namespace std::string_literals; } { NSDictionary *stops = @{@0: MGLConstantExpression(@111), @1: MGLConstantExpression(@1111)}; - NSExpression *expression = [NSExpression expressionWithFormat:@"FUNCTION($zoomLevel, 'mgl_stepWithMinimum:stops:', 11, %@)", stops]; + NSExpression *expression = [NSExpression expressionWithFormat:@"mgl_step:from:stops:($zoomLevel, 11, %@)", stops]; NSArray *jsonExpression = @[@"step", @[@"zoom"], @11, @0, @111, @1, @1111]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); XCTAssertEqualObjects([NSExpression mgl_expressionWithJSONObject:jsonExpression], expression); |