commit 6f1c033d72af8fe65bb67e17a242314b6aeb182f
parent 5f83fb658206d195e54d3574b989ce5285a5b18f
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 22 Nov 2019 11:07:20 -0300
More generic pattern when testing 'string.format'
The result of 'string.format("%a", 0.0)' can have multiple zeros
after the dot.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testes/strings.lua b/testes/strings.lua
@@ -309,8 +309,8 @@ do print("testing 'format %a %A'")
matchhexa(n)
end
- assert(string.find(string.format("%A", 0.0), "^0X0%.?0?P%+?0$"))
- assert(string.find(string.format("%a", -0.0), "^%-0x0%.?0?p%+?0$"))
+ assert(string.find(string.format("%A", 0.0), "^0X0%.?0*P%+?0$"))
+ assert(string.find(string.format("%a", -0.0), "^%-0x0%.?0*p%+?0$"))
if not _port then -- test inf, -inf, NaN, and -0.0
assert(string.find(string.format("%a", 1/0), "^inf"))