From e6639768e4a059aeaf80e232c729dffa3b5e93ba Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 22 May 2017 23:20:02 +1000 Subject: src/lauxlib.js: Use lua_pushfstring for formatting numbers --- tests/test-suite/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-suite/strings.js b/tests/test-suite/strings.js index 3584a80..d7b30a8 100644 --- a/tests/test-suite/strings.js +++ b/tests/test-suite/strings.js @@ -288,7 +288,7 @@ test('[test-suite] strings: tostring', function (t) { end if tostring(0.0) == "0.0" then -- "standard" coercion float->string - -- assert('' .. 12 == '12' and 12.0 .. '' == '12.0') -- TODO: How to do this in JS ? + assert('' .. 12 == '12' and 12.0 .. '' == '12.0') assert(tostring(-1203 + 0.0) == "-1203.0") else -- compatible coercion assert(tostring(0.0) == "0") -- cgit v1.2.3-54-g00ecf From 69fdbe3590eb2ddfa970888b7b59e8a84fbda101 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 00:09:21 +1000 Subject: tests/test-suite/strings.js: un-skip fixed test --- tests/test-suite/strings.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-suite/strings.js b/tests/test-suite/strings.js index d7b30a8..c501ddd 100644 --- a/tests/test-suite/strings.js +++ b/tests/test-suite/strings.js @@ -365,8 +365,7 @@ test('[test-suite] strings: string.format', function (t) { }); -// TODO: http://lua-users.org/lists/lua-l/2016-05/msg00455.html -test('[test-suite] strings: %q', { skip: true }, function (t) { +test('[test-suite] strings: %q', function (t) { let luaCode = ` do local function checkQ (v) -- cgit v1.2.3-54-g00ecf From 1188498c1f714c32c287dfb657894d51c77e2c1b Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 00:06:43 +1000 Subject: tests/test-suite/errors.js: un-skip test as we can now recover from a stack overflow --- tests/test-suite/errors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-suite/errors.js b/tests/test-suite/errors.js index c18adeb..47b4b2a 100644 --- a/tests/test-suite/errors.js +++ b/tests/test-suite/errors.js @@ -836,7 +836,7 @@ test("[test-suite] errors: testing line error", function (t) { }); -test("[test-suite] errors: several tests that exhaust the Lua stack", { skip: true }, function (t) { +test("[test-suite] errors: several tests that exhaust the Lua stack", function (t) { let luaCode = ` C = 0 local l = debug.getinfo(1, "l").currentline; function y () C=C+1; y() end -- cgit v1.2.3-54-g00ecf From 2aaf4a458734a46cbd3a4bfd8890206ed3c12594 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 00:07:22 +1000 Subject: tests/test-suite/nextvar.js: un-skip passing test --- tests/test-suite/nextvar.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-suite/nextvar.js b/tests/test-suite/nextvar.js index d119d97..28a54e7 100644 --- a/tests/test-suite/nextvar.js +++ b/tests/test-suite/nextvar.js @@ -907,8 +907,7 @@ test("[test-suite] nextvar: next", function (t) { }); -// TODO: infinite loop ? -test("[test-suite] nextvar: testing floats in numeric for", { skip: true }, function (t) { +test("[test-suite] nextvar: testing floats in numeric for", function (t) { let luaCode = ` do local a -- cgit v1.2.3-54-g00ecf From 56a72b0c1ce00b4de0b25318c3eabd6c48deab2e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 00:10:52 +1000 Subject: tests/test-suite/math.js: un-skip passing test --- tests/test-suite/math.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-suite/math.js b/tests/test-suite/math.js index e79281b..b92d304 100644 --- a/tests/test-suite/math.js +++ b/tests/test-suite/math.js @@ -746,7 +746,7 @@ test("[test-suite] math: 'tonumber' with strings", function (t) { }); -test("[test-suite] math: tests with very long numerals", { skip: true }, function (t) { +test("[test-suite] math: tests with very long numerals", function (t) { let luaCode = ` assert(tonumber("0x"..string.rep("f", 13)..".0") == 2.0^(4*13) - 1) assert(tonumber("0x"..string.rep("f", 150)..".0") == 2.0^(4*150) - 1) -- cgit v1.2.3-54-g00ecf From 0085399fa4b4a6e9450ab454a4ac33dd26db003e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 00:16:59 +1000 Subject: tests/test-suite/errors.js: un-skip passing test --- tests/test-suite/errors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-suite/errors.js b/tests/test-suite/errors.js index 47b4b2a..432ee35 100644 --- a/tests/test-suite/errors.js +++ b/tests/test-suite/errors.js @@ -950,7 +950,7 @@ test("[test-suite] errors: error in error handling", function (t) { }); -test("[test-suite] errors: too many results", { skip: true }, function (t) { +test("[test-suite] errors: too many results", function (t) { let luaCode = ` local function loop (x,y,z) return 1 + loop(x, y, z) end -- cgit v1.2.3-54-g00ecf From 275c497e20df141160b92db6503da0b98f611bc0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 00:23:54 +1000 Subject: tests/test-suite/errors.js: copy setup from previous test to get a skipped test passing --- tests/test-suite/errors.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test-suite/errors.js b/tests/test-suite/errors.js index 432ee35..5980724 100644 --- a/tests/test-suite/errors.js +++ b/tests/test-suite/errors.js @@ -871,9 +871,10 @@ test("[test-suite] errors: several tests that exhaust the Lua stack", function ( }); -test("[test-suite] errors: error lines in stack overflow", { skip: true }, function (t) { +test("[test-suite] errors: error lines in stack overflow", function (t) { let luaCode = ` C = 0 + local l = debug.getinfo(1, "l").currentline; function y () C=C+1; y() end local l1 local function g(x) l1 = debug.getinfo(x, "l").currentline; y() -- cgit v1.2.3-54-g00ecf From 8a439e5563f12335e3d35dd63b4f8cbcc25a9bd8 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 May 2017 00:27:09 +1000 Subject: tests/test-suite/events.js: un-skip fixed tests --- tests/test-suite/events.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/test-suite/events.js b/tests/test-suite/events.js index d5ed5ae..0f94f36 100644 --- a/tests/test-suite/events.js +++ b/tests/test-suite/events.js @@ -301,7 +301,6 @@ test("[test-suite] events: test comparison", function (t) { }); -// TODO: uncomment asserts when next is fixed for cleared table entries test("[test-suite] events: test 'partial order'", function (t) { let luaCode = ` t = {} @@ -327,9 +326,9 @@ test("[test-suite] events: test 'partial order'", function (t) { t.__le = nil assert(Set{1,2,3} < Set{1,2,3,4}) - -- assert(not(Set{1,2,3,4} < Set{1,2,3,4})) - -- assert((Set{1,2,3,4} <= Set{1,2,3,4})) - -- assert((Set{1,2,3,4} >= Set{1,2,3,4})) + assert(not(Set{1,2,3,4} < Set{1,2,3,4})) + assert((Set{1,2,3,4} <= Set{1,2,3,4})) + assert((Set{1,2,3,4} >= Set{1,2,3,4})) assert((Set{1,3} <= Set{3,5})) -- wrong!! model needs a 'le' method ;-) t.__le = function (a,b) @@ -352,11 +351,11 @@ test("[test-suite] events: test 'partial order'", function (t) { end local s = Set{1,3,5} - -- assert(s == Set{3,5,1}) + assert(s == Set{3,5,1}) assert(not rawequal(s, Set{3,5,1})) assert(rawequal(s, s)) - -- assert(Set{1,3,5,1} == rawSet{3,5,1}) - -- assert(rawSet{1,3,5,1} == Set{3,5,1}) + assert(Set{1,3,5,1} == rawSet{3,5,1}) + assert(rawSet{1,3,5,1} == Set{3,5,1}) assert(Set{1,3,5} ~= Set{3,5,1,6}) -- '__eq' is not used for table accesses -- cgit v1.2.3-54-g00ecf