File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
IntegrationTests/TestSuites/Sources/PrimaryTests Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -830,4 +830,35 @@ try test("Symbols") {
830
830
try expectEqual ( JSObject . global. Object. isInstanceOf ( hasInstanceClass) , true )
831
831
}
832
832
833
+ try test ( " BigInt " ) {
834
+ func expectPassesThrough( signed value: Int64 ) throws {
835
+ let bigInt = JSBigInt ( value)
836
+ try expectEqual ( bigInt. description, value. description)
837
+ }
838
+
839
+ func expectPassesThrough( unsigned value: UInt64 ) throws {
840
+ let bigInt = JSBigInt ( unsigned: value)
841
+ try expectEqual ( bigInt. description, value. description)
842
+ }
843
+
844
+ try expectPassesThrough ( signed: 0 )
845
+ try expectPassesThrough ( signed: 1 << 62 )
846
+ try expectPassesThrough ( signed: - 2305 )
847
+ for _ in 0 ..< 100 {
848
+ try expectPassesThrough ( signed: . random( in: . min ... . max) )
849
+ }
850
+ try expectPassesThrough ( signed: . min)
851
+ try expectPassesThrough ( signed: . max)
852
+
853
+ try expectPassesThrough ( unsigned: 0 )
854
+ try expectPassesThrough ( unsigned: 1 << 62 )
855
+ try expectPassesThrough ( unsigned: 1 << 63 )
856
+ try expectPassesThrough ( unsigned: . min)
857
+ try expectPassesThrough ( unsigned: . max)
858
+ try expectPassesThrough ( unsigned: ~ 0 )
859
+ for _ in 0 ..< 100 {
860
+ try expectPassesThrough ( unsigned: . random( in: . min ... . max) )
861
+ }
862
+ }
863
+
833
864
Expectation . wait ( expectations)
You can’t perform that action at this time.
0 commit comments