Fix incorrect test and simplify two ternary operators.

This commit is contained in:
Matyáš Kříž 2019-05-15 17:48:16 +02:00
parent 449b71e3db
commit b4c2bbe5b7
2 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,7 @@ public struct InstanceVariable: Token, HasAccessibility {
public func serialize() -> [String : Any] {
let readOnlyString = readOnly ? "ReadOnly" : ""
let optionalString = type.isOptional ? (readOnly ? "" : "Optional") : ""
let optionalString = type.isOptional && !readOnly ? "Optional" : ""
return [
"name": name,
"type": type.sugarized,

View File

@ -90,6 +90,8 @@ class GenericProtocolTest: XCTestCase {
when(mock.readOnlyPropertyC.get).thenReturn(MockTestedClass())
}
_ = mock.readOnlyPropertyC
verify(mock).readOnlyPropertyC.get()
}