summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-03-29 12:56:01 -0700
committerMinh Nguyễn <mxn@1ec5.org>2018-03-30 03:29:44 -0700
commitde077bd3ccf757b4c888e79b445c6dad80564bfa (patch)
treebe2df93253c21475146e44a2e02056a9528205c1
parent06e38407d24ce6bd9cf46b04c7d3d7b74c56f94a (diff)
downloadqtlocation-mapboxgl-de077bd3ccf757b4c888e79b445c6dad80564bfa.tar.gz
[ios, macos] Updated tests for aftermarket expressions
-rw-r--r--platform/darwin/test/MGLExpressionTests.mm5
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);