diff options
Diffstat (limited to 'platform/darwin/test/MGLDocumentationExampleTests.swift')
-rw-r--r-- | platform/darwin/test/MGLDocumentationExampleTests.swift | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 91fb02dfd2..45efe4c591 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -542,6 +542,24 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { } } + func testMGLAttributedExpression() { + //#-example-code + #if os(macOS) + let redColor = NSColor.red + #else + let redColor = UIColor.red + #endif + let expression = NSExpression(forConstantValue: "Foo") + let attributes: Dictionary<MGLAttributedExpressionKey, Any> = [.fontNamesAttribute : ["DIN Offc Pro Italic", + "Arial Unicode MS Regular"], + .fontSizeAttribute: 1.2, + .fontColorAttribute: redColor] + let attributedExpression = MGLAttributedExpression(expression, attributes:attributes) + //#-end-example-code + + XCTAssertNotNil(attributedExpression) + } + // For testMGLMapView(). func myCustomFunction() {} } |