You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/06/30 03:48:35 UTC

[GitHub] [incubator-kvrocks] xiaobiaozhao commented on a diff in pull request #697: ✨ feat: luajit replace lua

xiaobiaozhao commented on code in PR #697:
URL: https://github.com/apache/incubator-kvrocks/pull/697#discussion_r910580208


##########
tests/tcl/tests/unit/scripting.tcl:
##########
@@ -235,37 +235,37 @@ start_server {tags {"scripting"}} {
                 return h
         } 0
     } {d3ffffff0000000000}
-    test {EVAL - cmsgpack can pack and unpack circular references?} {
-        r eval {local a = {x=nil,y=5}
-                local b = {x=a}
-                a['x'] = b
-                local encoded = cmsgpack.pack(a)
-                local h = ""
-                -- cmsgpack encodes to a depth of 16, but can't encode
-                -- references, so the encoded object has a deep copy recursive
-                -- depth of 16.
-                for i = 1, #encoded do
-                    h = h .. string.format("%02x",string.byte(encoded,i))
-                end
-                -- when unpacked, re.x.x != re because the unpack creates
-                -- individual tables down to a depth of 16.
-                -- (that's why the encoded output is so large)
-                local re = cmsgpack.unpack(encoded)
-                assert(re)
-                assert(re.x)
-                assert(re.x.x.y == re.y)
-                assert(re.x.x.x.x.y == re.y)
-                assert(re.x.x.x.x.x.x.y == re.y)
-                assert(re.x.x.x.x.x.x.x.x.x.x.y == re.y)
-                -- maximum working depth:
-                assert(re.x.x.x.x.x.x.x.x.x.x.x.x.x.x.y == re.y)
-                -- now the last x would be b above and has no y
-                assert(re.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x)
-                -- so, the final x.x is at the depth limit and was assigned nil
-                assert(re.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x == nil)
-                return {h, re.x.x.x.x.x.x.x.x.y == re.y, re.y == 5}
-        } 0
-    } {82a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a178c0 1 1}
+    #test {EVAL - cmsgpack can pack and unpack circular references?} {
+    #    r eval {local a = {x=nil,y=5}

Review Comment:
   I had fix this test.  The case is from here https://github.com/antirez/lua-cmsgpack/blob/master/test.lua#L393



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org