|
1 |
| -// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors |
| 1 | +// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors |
2 | 2 | // Licensed under Apache License v2.0 with Runtime Library Exception
|
3 | 3 | //
|
4 | 4 | // See https://swift.org/LICENSE.txt for license information
|
@@ -371,6 +371,26 @@ class TestCodable : TestCodableSuper {
|
371 | 371 | expectEqual(value.lowerBound, decoded.lowerBound, "\(#file):\(#line): Decoded ClosedRange lowerBound <\(debugDescription(decoded))> not equal to original <\(debugDescription(value))>")
|
372 | 372 | }
|
373 | 373 |
|
| 374 | + // MARK: - ContiguousArray |
| 375 | + lazy var contiguousArrayValues: [Int : ContiguousArray<String>] = [ |
| 376 | + #line : [], |
| 377 | + #line : ["foo"], |
| 378 | + #line : ["foo", "bar"], |
| 379 | + #line : ["foo", "bar", "baz"], |
| 380 | + ] |
| 381 | + |
| 382 | + func test_ContiguousArray_JSON() { |
| 383 | + for (testLine, contiguousArray) in contiguousArrayValues { |
| 384 | + expectRoundTripEqualityThroughJSON(for: contiguousArray, lineNumber: testLine) |
| 385 | + } |
| 386 | + } |
| 387 | + |
| 388 | + func test_ContiguousArray_Plist() { |
| 389 | + for (testLine, contiguousArray) in contiguousArrayValues { |
| 390 | + expectRoundTripEqualityThroughPlist(for: contiguousArray, lineNumber: testLine) |
| 391 | + } |
| 392 | + } |
| 393 | + |
374 | 394 | // MARK: - DateComponents
|
375 | 395 | lazy var dateComponents: Set<Calendar.Component> = [
|
376 | 396 | .era, .year, .month, .day, .hour, .minute, .second, .nanosecond,
|
@@ -853,6 +873,8 @@ var tests = [
|
853 | 873 | "test_CGVector_Plist" : TestCodable.test_CGVector_Plist,
|
854 | 874 | "test_ClosedRange_JSON" : TestCodable.test_ClosedRange_JSON,
|
855 | 875 | "test_ClosedRange_Plist" : TestCodable.test_ClosedRange_Plist,
|
| 876 | + "test_ContiguousArray_JSON" : TestCodable.test_ContiguousArray_JSON, |
| 877 | + "test_ContiguousArray_Plist" : TestCodable.test_ContiguousArray_Plist, |
856 | 878 | "test_DateComponents_JSON" : TestCodable.test_DateComponents_JSON,
|
857 | 879 | "test_DateComponents_Plist" : TestCodable.test_DateComponents_Plist,
|
858 | 880 | "test_Decimal_JSON" : TestCodable.test_Decimal_JSON,
|
|
0 commit comments