@@ -8,6 +8,24 @@ assert.strictEqual(NumberLong(2147483647).toString(), 'NumberLong(2147483647)');
88assert . strictEqual ( NumberLong ( "2147483648" ) . toString ( ) , 'NumberLong("2147483648")' ) ;
99assert . strictEqual ( NumberLong ( - 2147483648 ) . toString ( ) , 'NumberLong(-2147483648)' ) ;
1010assert . strictEqual ( NumberLong ( - 2147483649 ) . toString ( ) , 'NumberLong("-2147483649")' ) ;
11+
12+ const int1 = NumberInt ( 42 ) ;
13+ assert . strictEqual ( int1 . toString ( ) , 'NumberInt(42)' ) ;
14+ assert . strictEqual ( int1 . tojson ( ) , 'NumberInt(42)' ) ;
15+ assert . strictEqual ( int1 . toNumber ( ) , 42 ) ;
16+ assert . strictEqual ( int1 . valueOf ( ) , 42 ) ;
17+ assert . strictEqual ( int1 . toJSON ( ) , 42 ) ;
18+ const int2 = NumberInt ( - 100 ) ;
19+ assert . strictEqual ( int2 . toString ( ) , 'NumberInt(-100)' ) ;
20+ assert . strictEqual ( int2 . tojson ( ) , 'NumberInt(-100)' ) ;
21+ assert . strictEqual ( int2 . toNumber ( ) , - 100 ) ;
22+ const maxInt32 = NumberInt ( 2147483647 ) ;
23+ assert . strictEqual ( maxInt32 . toString ( ) , 'NumberInt(2147483647)' ) ;
24+ assert . strictEqual ( maxInt32 . toNumber ( ) , 2147483647 ) ;
25+ const minInt32 = NumberInt ( - 2147483648 ) ;
26+ assert . strictEqual ( minInt32 . toString ( ) , 'NumberInt(-2147483648)' ) ;
27+ assert . strictEqual ( minInt32 . toNumber ( ) , - 2147483648 ) ;
28+
1129assert . strictEqual ( NumberLong ( 9223372036854775807 ) . toString ( ) , 'NumberLong("9223372036854775807")' ) ;
1230assert . strictEqual ( NumberLong ( - 9223372036854775808 ) . toString ( ) , 'NumberLong("-9223372036854775808")' ) ;
1331const maxLong = NumberLong ( 9223372036854775807 , 2147483647 , - 1 ) ;
0 commit comments