summaryrefslogtreecommitdiff
path: root/tests/json.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/json.lua')
-rw-r--r--tests/json.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/json.lua b/tests/json.lua
new file mode 100644
index 0000000..a659889
--- /dev/null
+++ b/tests/json.lua
@@ -0,0 +1,10 @@
+local file = io.open("tests/test.json", "r")
+local content = file:read("*a")
+file:close()
+
+local data = json.decode(content)
+
+print("name: " .. data.name)
+for _, n in pairs(data.numbers) do
+ print(" - number: " .. n)
+end