Skip to content

Commit b83611f

Browse files
committed
fix tests?
1 parent b7a6a7d commit b83611f

File tree

3 files changed

+37
-32
lines changed

3 files changed

+37
-32
lines changed

IntegrationTests/TestSuites/Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ let package = Package(
2525
targets: [
2626
.target(name: "CHelpers"),
2727
.target(name: "PrimaryTests", dependencies: [
28+
.product(name: "JavaScriptKit_I64", package: "JavaScriptKit"),
2829
"JavaScriptKit",
2930
"CHelpers",
3031
]),
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import JavaScriptKit
2+
import JavaScriptKit_I64
3+
4+
func testI64() throws {
5+
try test("BigInt") {
6+
func expectPassesThrough(signed value: Int64) throws {
7+
let bigInt = JSBigInt(value)
8+
try expectEqual(bigInt.description, value.description)
9+
}
10+
11+
func expectPassesThrough(unsigned value: UInt64) throws {
12+
let bigInt = JSBigInt(unsigned: value)
13+
try expectEqual(bigInt.description, value.description)
14+
}
15+
16+
try expectPassesThrough(signed: 0)
17+
try expectPassesThrough(signed: 1 << 62)
18+
try expectPassesThrough(signed: -2305)
19+
for _ in 0 ..< 100 {
20+
try expectPassesThrough(signed: .random(in: .min ... .max))
21+
}
22+
try expectPassesThrough(signed: .min)
23+
try expectPassesThrough(signed: .max)
24+
25+
try expectPassesThrough(unsigned: 0)
26+
try expectPassesThrough(unsigned: 1 << 62)
27+
try expectPassesThrough(unsigned: 1 << 63)
28+
try expectPassesThrough(unsigned: .min)
29+
try expectPassesThrough(unsigned: .max)
30+
try expectPassesThrough(unsigned: ~0)
31+
for _ in 0 ..< 100 {
32+
try expectPassesThrough(unsigned: .random(in: .min ... .max))
33+
}
34+
}
35+
}

IntegrationTests/TestSuites/Sources/PrimaryTests/main.swift

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -852,36 +852,5 @@ try test("JSValueDecoder") {
852852
try expectEqual(decodedTama.isCat, true)
853853
}
854854

855-
856-
try test("BigInt") {
857-
func expectPassesThrough(signed value: Int64) throws {
858-
let bigInt = JSBigInt(value)
859-
try expectEqual(bigInt.description, value.description)
860-
}
861-
862-
func expectPassesThrough(unsigned value: UInt64) throws {
863-
let bigInt = JSBigInt(unsigned: value)
864-
try expectEqual(bigInt.description, value.description)
865-
}
866-
867-
try expectPassesThrough(signed: 0)
868-
try expectPassesThrough(signed: 1 << 62)
869-
try expectPassesThrough(signed: -2305)
870-
for _ in 0 ..< 100 {
871-
try expectPassesThrough(signed: .random(in: .min ... .max))
872-
}
873-
try expectPassesThrough(signed: .min)
874-
try expectPassesThrough(signed: .max)
875-
876-
try expectPassesThrough(unsigned: 0)
877-
try expectPassesThrough(unsigned: 1 << 62)
878-
try expectPassesThrough(unsigned: 1 << 63)
879-
try expectPassesThrough(unsigned: .min)
880-
try expectPassesThrough(unsigned: .max)
881-
try expectPassesThrough(unsigned: ~0)
882-
for _ in 0 ..< 100 {
883-
try expectPassesThrough(unsigned: .random(in: .min ... .max))
884-
}
885-
}
886-
855+
try testI64()
887856
Expectation.wait(expectations)

0 commit comments

Comments
 (0)