diff options
author | Yevhenii Shapovalov <yshapova@redhat.com> | 2017-11-09 13:39:24 +0200 |
---|---|---|
committer | Yevhenii Shapovalov <yshapova@redhat.com> | 2017-11-09 13:39:24 +0200 |
commit | 7b824e0268575e4c13c624b54b2a1280aa295f7f (patch) | |
tree | 4ae2e36e9e6b708845fb15fdd002f0e20c384421 /tests/Smoke/globals.lua | |
parent | 8a0d5153089bcc081fd088027b52b4c90c76b769 (diff) | |
download | lua-add_test.tar.gz lua-add_test.tar.xz lua-add_test.zip |
Diffstat (limited to 'tests/Smoke/globals.lua')
-rw-r--r-- | tests/Smoke/globals.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Smoke/globals.lua b/tests/Smoke/globals.lua new file mode 100644 index 0000000..e053f36 --- /dev/null +++ b/tests/Smoke/globals.lua @@ -0,0 +1,23 @@ +-- globals.lua +-- show all global variables + +local seen={} + +function dump(t,i) + seen[t]=true + local s={} + local n=0 + for k in pairs(t) do + n=n+1 s[n]=k + end + table.sort(s) + for k,v in ipairs(s) do + print(i,v) + v=t[v] + if type(v)=="table" and not seen[v] then + dump(v,i.."\t") + end + end +end + +dump(_G,"") |