summaryrefslogtreecommitdiff
path: root/tests/single.lua
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-10 13:47:01 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-10 13:54:58 +0200
commit204ab9fba5a7a1e2e6981c11e0a6c67764332d21 (patch)
tree4976b9295969a7b0a2b4b124710d235771f325e4 /tests/single.lua
parent89e4a76a812499cc108bb77fb5c9ae1877123df6 (diff)
downloadfengari-204ab9fba5a7a1e2e6981c11e0a6c67764332d21.tar.gz
fengari-204ab9fba5a7a1e2e6981c11e0a6c67764332d21.tar.bz2
fengari-204ab9fba5a7a1e2e6981c11e0a6c67764332d21.zip
nan, -inf, inf
Diffstat (limited to 'tests/single.lua')
-rw-r--r--tests/single.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/single.lua b/tests/single.lua
index c770d22..c167196 100644
--- a/tests/single.lua
+++ b/tests/single.lua
@@ -271,17 +271,17 @@ do print("testing 'format %a %A'")
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"))
- -- assert(string.find(string.format("%A", -1/0), "^%-INF"))
- -- assert(string.find(string.format("%a", 0/0), "^%-?nan"))
- -- assert(string.find(string.format("%a", -0.0), "^%-0x0"))
- -- end
+ if not _port then -- test inf, -inf, NaN, and -0.0
+ assert(string.find(string.format("%a", 1/0), "^inf"))
+ assert(string.find(string.format("%A", -1/0), "^%-INF"))
+ assert(string.find(string.format("%a", 0/0), "^%-?nan"))
+ assert(string.find(string.format("%a", -0.0), "^%-0x0"))
+ end
- -- if not pcall(string.format, "%.3a", 0) then
- -- (Message or print)("\n >>> modifiers for format '%a' not available <<<\n")
- -- else
- -- assert(string.find(string.format("%+.2A", 12), "^%+0X%x%.%x0P%+?%d$"))
- -- assert(string.find(string.format("%.4A", -12), "^%-0X%x%.%x000P%+?%d$"))
- -- end
+ if not pcall(string.format, "%.3a", 0) then
+ (Message or print)("\n >>> modifiers for format '%a' not available <<<\n")
+ else
+ assert(string.find(string.format("%+.2A", 12), "^%+0X%x%.%x0P%+?%d$"))
+ assert(string.find(string.format("%.4A", -12), "^%-0X%x%.%x000P%+?%d$"))
+ end
end