mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 10:48:29 +00:00
Make fixes and improvements
- Fix handling of precision in hex float formatting - Enhance the cocmd interpreter for system() and popen() - Manually ran the Lua unit tests, which are now passing - Let stdio i/o operations happen when file is in error state - We're now saving and restoring xmm in ftrace out of paranoia
This commit is contained in:
parent
95fbdb4f76
commit
41396ff48a
43 changed files with 495 additions and 261 deletions
15
third_party/lua/test/files.lua
vendored
15
third_party/lua/test/files.lua
vendored
|
@ -792,9 +792,18 @@ assert(os.date(string.rep("%", 200)) == string.rep("%", 100))
|
|||
local function checkDateTable (t)
|
||||
_G.D = os.date("*t", t)
|
||||
assert(os.time(D) == t)
|
||||
load(os.date([[assert(D.year==%Y and D.month==%m and D.day==%d and
|
||||
D.hour==%H and D.min==%M and D.sec==%S and
|
||||
D.wday==%w+1 and D.yday==%j)]], t))()
|
||||
-- [jart] rewrote test due to octal
|
||||
assert(string.format('%d', D.year) == os.date('%Y', t))
|
||||
assert(string.format('%02d', D.month) == os.date('%m', t))
|
||||
assert(string.format('%02d', D.day) == os.date('%d', t))
|
||||
assert(string.format('%02d', D.hour) == os.date('%H', t))
|
||||
assert(string.format('%02d', D.min) == os.date('%M', t))
|
||||
assert(string.format('%02d', D.sec) == os.date('%S', t))
|
||||
assert(string.format('%d', D.wday - 1) == os.date('%w', t))
|
||||
assert(string.format('%03d', D.yday) == os.date('%j', t))
|
||||
-- load(os.date([[assert(D.year==%Y and D.month==%m and D.day==%d and
|
||||
-- D.hour==%H and D.min==%M and D.sec==%S and
|
||||
-- D.wday==%w+1 and D.yday==%j)]], t))()
|
||||
_G.D = nil
|
||||
end
|
||||
|
||||
|
|
2
third_party/lua/test/literals.lua
vendored
2
third_party/lua/test/literals.lua
vendored
|
@ -25,7 +25,7 @@ assert("\099" == '\99')
|
|||
assert("\099\n" == 'c\10')
|
||||
assert('\0\0\0alo' == '\0' .. '\0\0' .. 'alo')
|
||||
|
||||
assert(010 .. 020 .. -030 == "1020-30")
|
||||
assert(10 .. 20 .. -30 == "1020-30") -- [jart] octal extension
|
||||
|
||||
-- hexadecimal escapes
|
||||
assert("\x00\x05\x10\x1f\x3C\xfF\xe8" == "\0\5\16\31\60\255\232")
|
||||
|
|
2
third_party/lua/test/math.lua
vendored
2
third_party/lua/test/math.lua
vendored
|
@ -401,7 +401,7 @@ assert(tonumber("-0x"..string.rep("f", (intbits//4))) == 1)
|
|||
|
||||
-- testing 'tonumber' with base
|
||||
assert(tonumber(' 001010 ', 2) == 10)
|
||||
assert(tonumber(' 001010 ', 10) == 001010)
|
||||
assert(tonumber(' 001010 ', 10) == 1010) -- [jart] octal extension fix
|
||||
assert(tonumber(' -1010 ', 2) == -10)
|
||||
assert(tonumber('10', 36) == 36)
|
||||
assert(tonumber(' -10 ', 36) == -36)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue