Skip to content
Closed
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
35 changes: 23 additions & 12 deletions Tests/FoundationEssentialsTests/JSONEncoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ import FoundationEssentials
import Foundation
#endif

var isLinux: Bool {
#if os(Linux)
true
#else
false
#endif
}

// MARK: - Test Suite

@Suite("JSONEncoder")
Expand Down Expand Up @@ -1433,18 +1441,21 @@ 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
])

@Test(
.disabled(if: isLinux, "This test is not applicable on this platform"),
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)
}
Expand Down
Loading