Fix incorrect test and simplify two ternary operators.
This commit is contained in:
parent
449b71e3db
commit
b4c2bbe5b7
|
@ -31,7 +31,7 @@ public struct InstanceVariable: Token, HasAccessibility {
|
||||||
|
|
||||||
public func serialize() -> [String : Any] {
|
public func serialize() -> [String : Any] {
|
||||||
let readOnlyString = readOnly ? "ReadOnly" : ""
|
let readOnlyString = readOnly ? "ReadOnly" : ""
|
||||||
let optionalString = type.isOptional ? (readOnly ? "" : "Optional") : ""
|
let optionalString = type.isOptional && !readOnly ? "Optional" : ""
|
||||||
return [
|
return [
|
||||||
"name": name,
|
"name": name,
|
||||||
"type": type.sugarized,
|
"type": type.sugarized,
|
||||||
|
|
|
@ -90,6 +90,8 @@ class GenericProtocolTest: XCTestCase {
|
||||||
when(mock.readOnlyPropertyC.get).thenReturn(MockTestedClass())
|
when(mock.readOnlyPropertyC.get).thenReturn(MockTestedClass())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ = mock.readOnlyPropertyC
|
||||||
|
|
||||||
verify(mock).readOnlyPropertyC.get()
|
verify(mock).readOnlyPropertyC.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue