Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 26 additions & 28 deletions Tests/FoundationEssentialsTests/JSONEncoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1393,21 +1393,20 @@ private struct JSONEncoderTests {
_testRoundTrip(of: testValue)
}

@Test(arguments: [
Int128.min,
Int128.min + 1,
-0x1_0000_0000_0000_0000,
0x0_8000_0000_0000_0000,
-1,
0,
0x7fff_ffff_ffff_ffff,
0x8000_0000_0000_0000,
0xffff_ffff_ffff_ffff,
0x1_0000_0000_0000_0000,
.max
])
func roundTrippingInt128(i128: Int128) {
_testRoundTrip(of: i128)
@Test func roundTrippingInt128() {
for i128 in [Int128.min,
Int128.min + 1,
-0x1_0000_0000_0000_0000,
0x0_8000_0000_0000_0000,
-1,
0,
0x7fff_ffff_ffff_ffff,
0x8000_0000_0000_0000,
0xffff_ffff_ffff_ffff,
0x1_0000_0000_0000_0000,
.max] {
_testRoundTrip(of: i128)
}
}

@Test func int128SlowPath() throws {
Expand All @@ -1434,19 +1433,18 @@ private struct JSONEncoderTests {
}
}

@Test(arguments: [
UInt128.zero,
1,
0x0000_0000_0000_0000_7fff_ffff_ffff_ffff,
0x0000_0000_0000_0000_8000_0000_0000_0000,
0x0000_0000_0000_0000_ffff_ffff_ffff_ffff,
0x0000_0000_0000_0001_0000_0000_0000_0000,
0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff,
0x8000_0000_0000_0000_0000_0000_0000_0000,
.max
])
func roundTrippingUInt128(u128: UInt128) {
_testRoundTrip(of: u128)
@Test func roundTrippingUInt128() {
for u128 in [UInt128.zero,
1,
0x0000_0000_0000_0000_7fff_ffff_ffff_ffff,
0x0000_0000_0000_0000_8000_0000_0000_0000,
0x0000_0000_0000_0000_ffff_ffff_ffff_ffff,
0x0000_0000_0000_0001_0000_0000_0000_0000,
0x7fff_ffff_ffff_ffff_ffff_ffff_ffff_ffff,
0x8000_0000_0000_0000_0000_0000_0000_0000,
.max] {
_testRoundTrip(of: u128)
}
}

@Test func uint128SlowPath() throws {
Expand Down
Loading