jashkenas--coffeescript/test/numbers_bigint.coffee

21 lines
473 B
CoffeeScript

# BigInt Literals
# ---------------
test "BigInt exists", ->
'object' is typeof BigInt
test "Parser recognizes decimal BigInt literals", ->
eq 42n, BigInt 42
test "Parser recognizes decimal BigInt literals with separator", ->
eq 1_000n, BigInt 1000
test "Parser recognizes binary BigInt literals", ->
eq 42n, 0b101010n
test "Parser recognizes octal BigInt literals", ->
eq 42n, 0o52n
test "Parser recognizes hexadecimal BigInt literals", ->
eq 42n, 0x2an