msva / lua-htmlparser

An HTML parser for lua.
231 stars 44 forks source link

Test fails with LuaJIT 2.2 #24

Closed mibamur closed 10 years ago

mibamur commented 10 years ago

clone lua-htmlparser make changes in dependency luarocks build htmlparser-0.1.1-1.rockspec

 ✘ debadmin@deb (master) ~/doc/lua/lua-htmlparser/tst
$ lua init.lua 
Loaded testsuite with 13 tests in 1 testcases.

    F...FF..FF...

64 Assertions checked.

  1) Failure (html.test_attr_prefix_start_end):
init.lua:133: expected 4 but was 3
init.lua:133: a1^='en'

  2) Failure (html.test_attr_word):
init.lua:146: expected 2 but was 1
init.lua:146: a1~='three'

  3) Failure (html.test_combine):
init.lua:249: expected 1 but was 0
init.lua:249: #123 .c[b]

  4) Failure (html.test_attr_notequal):
init.lua:118: expected 4 but was 3
init.lua:118: a1!='b1'

  5) Failure (html.test_attr_contains):
init.lua:161: expected 2 but was 1
init.lua:161: a1*='t'

Testsuite finished (8 passed, 5 failed, 0 errors).

 ✘ debadmin@deb (master) ~/doc/lua/lua-htmlparser/tst
$ 

What functions from Lua 5.2 necassary for good work?

wscherphof commented 10 years ago

I guess the goto statement and the # operator on table variables should cover it

mibamur commented 10 years ago

Thx! I`ll go to try it solution

peersuasive commented 10 years ago

I don't think this bug is fixed, as I meet it with lua 5.2.2.

After a bit of debugging, it appeared that self.deepattributes (at least) is modified instead of the copy Set should create. The issue seems to come from Set:new(), which returns immediatly if the table to copy is already a Set.

wscherphof commented 10 years ago

Thanks a LOT. Nailed it in Set. Will update the repo's..