summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-03 13:01:11 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-03 13:01:11 -0400
commit93c21b503abdf4f9530064f8c3f1df7ea0dc244f (patch)
treee2512510dca3f395ded13481802acf4161d02e28 /indra
parent2157fa4fa9acf4db6093b962569274105e4d1fb4 (diff)
test_inv_resultset.lua exercises LLInventory's result-set functionality.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/scripts/lua/test_inv_resultset.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_inv_resultset.lua b/indra/newview/scripts/lua/test_inv_resultset.lua
new file mode 100644
index 0000000000..c31cfe3c67
--- /dev/null
+++ b/indra/newview/scripts/lua/test_inv_resultset.lua
@@ -0,0 +1,18 @@
+local LLInventory = require 'LLInventory'
+local inspect = require 'inspect'
+
+print('basic folders:')
+print(inspect(LLInventory.getFolderTypeNames()))
+
+local folder = LLInventory.getBasicFolderID('my_otfts')
+print(`folder = {folder}`)
+local result = LLInventory.getDirectDescendants(folder)
+print(`type(result) = {type(result)}`)
+print(#result.categories, 'categories:')
+for i, cat in pairs(result.categories) do
+ print(`{i}: {cat.name}`)
+end
+print(#result.items, 'items')
+for i, item in pairs(result.items) do
+ print(`{i}: {item.name}`)
+end