mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-05-17 10:30:35 +00:00
27 lines
827 B
Swift
Executable File
27 lines
827 B
Swift
Executable File
// Copyright © 2017 Schibsted. All rights reserved.
|
|
|
|
import XCTest
|
|
@testable import Layout
|
|
|
|
final class OptionSetExpressionTests: XCTestCase {
|
|
func testSingleDataDetectorType() {
|
|
let node = LayoutNode(
|
|
view: UITextView(),
|
|
expressions: [
|
|
"dataDetectorTypes": "phoneNumber",
|
|
]
|
|
)
|
|
XCTAssertEqual(try node.value(forSymbol: "dataDetectorTypes") as? UIDataDetectorTypes, .phoneNumber)
|
|
}
|
|
|
|
func testMultipleDataDetectorTypes() {
|
|
let node = LayoutNode(
|
|
view: UITextView(),
|
|
expressions: [
|
|
"dataDetectorTypes": "phoneNumber, address, link",
|
|
]
|
|
)
|
|
XCTAssertEqual(try node.value(forSymbol: "dataDetectorTypes") as? UIDataDetectorTypes, [.phoneNumber, .address, .link])
|
|
}
|
|
}
|