Skip to content

Commit e28c7c9

Browse files
committed
Avoid passing (U)Int128 as test args
1 parent 3ee8bc0 commit e28c7c9

File tree

1 file changed

+24
-27
lines changed

1 file changed

+24
-27
lines changed

Tests/FoundationEssentialsTests/JSONEncoderTests.swift

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,20 +1393,18 @@ 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) {
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] {
14101408
_testRoundTrip(of: i128)
14111409
}
14121410

@@ -1434,19 +1432,18 @@ private struct JSONEncoderTests {
14341432
}
14351433
}
14361434

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)
1435+
@Test func roundTrippingUInt128() {
1436+
for u128 in [UInt128.zero,
1437+
1,
1438+
0x0000_0000_0000_0000_7fff_ffff_ffff_ffff,
1439+
0x0000_0000_0000_0000_8000_0000_0000_0000,
1440+
0x0000_0000_0000_0000_ffff_ffff_ffff_ffff,
1441+
0x0000_0000_0000_0001_0000_0000_0000_0000,
1442+
0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff,
1443+
0x8000_0000_0000_0000_0000_0000_0000_0000,
1444+
.max] {
1445+
_testRoundTrip(of: u128)
1446+
}
14501447
}
14511448

14521449
@Test func uint128SlowPath() throws {

0 commit comments

Comments
 (0)