mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Fix Lua type of zero
This change fixes a regression from 281a0f27
which resulted in the
integer literal `0` being interpreted as a floating point number. This
should also fix a reported issue with Fennel integration.
This commit is contained in:
parent
fe5c475f83
commit
50a6df89b8
2 changed files with 11 additions and 1 deletions
|
@ -32,6 +32,16 @@ assert(Bsf(0x80000001) == 0)
|
|||
assert(Lemur64() == 0x1940efe9d47ae889)
|
||||
assert(Lemur64() == 0xd4b3103f567f9974)
|
||||
|
||||
assert(EncodeLua(nil) == "nil")
|
||||
assert(EncodeLua(0) == "0")
|
||||
assert(EncodeLua(3.14) == "3.14")
|
||||
assert(EncodeLua({1, 2}) == "{1, 2}")
|
||||
|
||||
assert(EncodeJson(nil) == "null")
|
||||
assert(EncodeJson(0) == "0")
|
||||
assert(EncodeJson(3.14) == "3.14")
|
||||
assert(EncodeJson({1, 2}) == "[1,2]")
|
||||
|
||||
assert(hex(0x1940efe9d47ae889) == "0x1940efe9d47ae889")
|
||||
assert(oct(0x1940efe9d47ae889) == "0145007376472436564211")
|
||||
assert(bin(0x1940efe9d47ae889) == "0b0001100101000000111011111110100111010100011110101110100010001001")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue