         fatalError("\(#file):\(lineNumber): Unable to encode \(T.self) <\(debugDescription(value))>: \(error)")
     }
 
-    let decoded: T
     do {
-        decoded = try decode(data)
+        return try decode(T.self, data)
     } catch {
         fatalError("\(#file):\(lineNumber): Unable to decode \(T.self) <\(debugDescription(value))>: \(error)")
     }
+}
+
+func expectRoundTripEquality<T : Codable>(of value: T, encode: (T) throws -> Data, decode: (T.Type, Data) throws -> T, lineNumber: Int) where T : Equatable {
+
+    let decoded = performEncodeAndDecode(of: value, encode: encode, decode: decode, lineNumber: lineNumber)
 
     expectEqual(value, decoded, "\(#file):\(lineNumber): Decoded \(T.self) <\(debugDescription(decoded))> not equal to original <\(debugDescription(value))>")
 }

        return try PropertyListEncoder().encode(value)
    }

    let decode = { (_ data: Data) throws -> T in
        return try PropertyListDecoder().decode(T.self, from: data)
    }

    expectRoundTripEquality(of: value, encode: encode, decode: decode, lineNumber: lineNumber)

    "test_CGRect_Plist" : TestCodable.test_CGRect_Plist,
    "test_CGVector_JSON" : TestCodable.test_CGVector_JSON,
    "test_CGVector_Plist" : TestCodable.test_CGVector_Plist,
    "test_ClosedRange_JSON" : TestCodable.test_ClosedRange_JSON,
    "test_ClosedRange_Plist" : TestCodable.test_ClosedRange_Plist,
    "test_DateComponents_JSON" : TestCodable.test_DateComponents_JSON,
    "test_DateComponents_Plist" : TestCodable.test_DateComponents_Plist,
    "test_Decimal_JSON" : TestCodable.test_Decimal_JSON,
