Skip to content

Commit 1c53883

Browse files
authored
Avoid passing (U)Int128 as test args (#1376)
* Avoid passing (U)Int128 as test args * Fix build issue
1 parent 90ef7f1 commit 1c53883

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

Tests/FoundationEssentialsTests/JSONEncoderTests.swift

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,21 +1393,20 @@ private struct JSONEncoderTests {
13931393
_testRoundTrip(of: testValue)
13941394
}
13951395

1396-
@Test(arguments: [
1397-
Int128.min,
1398-
Int128.min + 1,
1399-
-0x1_0000_0000_0000_0000,
1400-
0x0_8000_0000_0000_0000,
1401-
-1,
1402-
0,
1403-
0x7fff_ffff_ffff_ffff,
1404-
0x8000_0000_0000_0000,
1405-
0xffff_ffff_ffff_ffff,
1406-
0x1_0000_0000_0000_0000,
1407-
.max
1408-
])
1409-
func roundTrippingInt128(i128: Int128) {
1410-
_testRoundTrip(of: i128)
1396+
@Test func roundTrippingInt128() {
1397+
for i128 in [Int128.min,
1398+
Int128.min + 1,
1399+
-0x1_0000_0000_0000_0000,
1400+
0x0_8000_0000_0000_0000,
1401+
-1,
1402+
0,
1403+
0x7fff_ffff_ffff_ffff,
1404+
0x8000_0000_0000_0000,
1405+
0xffff_ffff_ffff_ffff,
1406+
0x1_0000_0000_0000_0000,
1407+
.max] {
1408+
_testRoundTrip(of: i128)
1409+
}
14111410
}
14121411

14131412
@Test func int128SlowPath() throws {
@@ -1434,19 +1433,18 @@ private struct JSONEncoderTests {
14341433
}
14351434
}
14361435

1437-
@Test(arguments: [
1438-
UInt128.zero,
1439-
1,
1440-
0x0000_0000_0000_0000_7fff_ffff_ffff_ffff,
1441-
0x0000_0000_0000_0000_8000_0000_0000_0000,
1442-
0x0000_0000_0000_0000_ffff_ffff_ffff_ffff,
1443-
0x0000_0000_0000_0001_0000_0000_0000_0000,
1444-
0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff,
1445-
0x8000_0000_0000_0000_0000_0000_0000_0000,
1446-
.max
1447-
])
1448-
func roundTrippingUInt128(u128: UInt128) {
1449-
_testRoundTrip(of: u128)
1436+
@Test func roundTrippingUInt128() {
1437+
for u128 in [UInt128.zero,
1438+
1,
1439+
0x0000_0000_0000_0000_7fff_ffff_ffff_ffff,
1440+
0x0000_0000_0000_0000_8000_0000_0000_0000,
1441+
0x0000_0000_0000_0000_ffff_ffff_ffff_ffff,
1442+
0x0000_0000_0000_0001_0000_0000_0000_0000,
1443+
0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff,
1444+
0x8000_0000_0000_0000_0000_0000_0000_0000,
1445+
.max] {
1446+
_testRoundTrip(of: u128)
1447+
}
14501448
}
14511449

14521450
@Test func uint128SlowPath() throws {

0 commit comments

Comments
 (0)