summaryrefslogtreecommitdiff
path: root/test/fixtures
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-04-25 19:19:28 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-07 16:41:37 +0000
commitabd7f486a0fb34320e3afae6780677cfd4ff85cc (patch)
treef2633cc76e78e35300a7dafdf3bce1bd8bcf2b7b /test/fixtures
parentRemove spare semi colons (diff)
downloadilt-abd7f486a0fb34320e3afae6780677cfd4ff85cc.tar.bz2
ilt-abd7f486a0fb34320e3afae6780677cfd4ff85cc.tar.xz
ilt-abd7f486a0fb34320e3afae6780677cfd4ff85cc.zip
Erring toward complete JSON loader
Diffstat (limited to 'test/fixtures')
-rw-r--r--test/fixtures/json/abs.json7
-rw-r--r--test/fixtures/json/empty.json6
-rw-r--r--test/fixtures/json/empty_abs.json6
-rw-r--r--test/fixtures/json/implicit.json8
-rw-r--r--test/fixtures/json/implicit_abs.json8
-rw-r--r--test/fixtures/json/load_object.json55
-rw-r--r--test/fixtures/json/nested.json21
-rw-r--r--test/fixtures/json/vector_ptr.json13
8 files changed, 124 insertions, 0 deletions
diff --git a/test/fixtures/json/abs.json b/test/fixtures/json/abs.json
new file mode 100644
index 0000000..8492df3
--- /dev/null
+++ b/test/fixtures/json/abs.json
@@ -0,0 +1,7 @@
+{
+ "aptr": {
+ "@typeid": "SubObject",
+ "base": "set base",
+ "sub": "set sub"
+ }
+}
diff --git a/test/fixtures/json/empty.json b/test/fixtures/json/empty.json
new file mode 100644
index 0000000..a9193a3
--- /dev/null
+++ b/test/fixtures/json/empty.json
@@ -0,0 +1,6 @@
+{
+ "@typeid": "TestObject",
+ "flt": 1,
+ "ptr": {},
+ "str": "after"
+}
diff --git a/test/fixtures/json/empty_abs.json b/test/fixtures/json/empty_abs.json
new file mode 100644
index 0000000..7d22001
--- /dev/null
+++ b/test/fixtures/json/empty_abs.json
@@ -0,0 +1,6 @@
+{
+ "@typeid": "TestObject",
+ "flt": 1,
+ "aptr": {},
+ "str": "after"
+}
diff --git a/test/fixtures/json/implicit.json b/test/fixtures/json/implicit.json
new file mode 100644
index 0000000..03dec4b
--- /dev/null
+++ b/test/fixtures/json/implicit.json
@@ -0,0 +1,8 @@
+{
+ "@typeid": "TestObject",
+ "flt": 1,
+ "ptr": {
+ "str": "trigger"
+ },
+ "str": "after"
+}
diff --git a/test/fixtures/json/implicit_abs.json b/test/fixtures/json/implicit_abs.json
new file mode 100644
index 0000000..573b323
--- /dev/null
+++ b/test/fixtures/json/implicit_abs.json
@@ -0,0 +1,8 @@
+{
+ "@typeid": "TestObject",
+ "flt": 1,
+ "aptr": {
+ "str": "trigger"
+ },
+ "str": "after"
+}
diff --git a/test/fixtures/json/load_object.json b/test/fixtures/json/load_object.json
new file mode 100644
index 0000000..bb32298
--- /dev/null
+++ b/test/fixtures/json/load_object.json
@@ -0,0 +1,55 @@
+{
+ "@typeid": "TestObject",
+ "flt": 3.14,
+ "str": "Lovely string",
+ "bl": true,
+ "pos": [
+ 3.14,
+ 6.28,
+ 1.57
+ ],
+ "flts": [
+ 3.14,
+ 6.28,
+ 1.57,
+ 0,
+ -1,
+ -3.14
+ ],
+ "poss": [
+ [
+ 3.14,
+ 6.28,
+ 1.57
+ ],
+ [
+ 0,
+ -1,
+ -3.14
+ ]
+ ],
+ "nest": [
+ [
+ [
+ "a",
+ "b"
+ ],
+ [
+ "c",
+ "d",
+ "e"
+ ]
+ ],
+ [
+ [
+ "f"
+ ]
+ ],
+ []
+ ],
+ "ptr": {
+ "@typeid": "TestObject",
+ "flt": 3.14,
+ "str": "Lovely string"
+ }
+}
diff --git a/test/fixtures/json/nested.json b/test/fixtures/json/nested.json
new file mode 100644
index 0000000..98951fc
--- /dev/null
+++ b/test/fixtures/json/nested.json
@@ -0,0 +1,21 @@
+{
+ "@typeid": "TestObject",
+ "flt": 1,
+ "ptr": {
+ "@typeid": "TestObject",
+ "flt": 2,
+ "ptr": {
+ "@typeid": "TestObject",
+ "flt": 3,
+ "ptr": {
+ "@typeid": "TestObject",
+ "flt": 4,
+ "ptr": null,
+ "str": "four"
+ },
+ "str": "three"
+ },
+ "str": "two"
+ },
+ "str": "one"
+}
diff --git a/test/fixtures/json/vector_ptr.json b/test/fixtures/json/vector_ptr.json
new file mode 100644
index 0000000..8a07a2e
--- /dev/null
+++ b/test/fixtures/json/vector_ptr.json
@@ -0,0 +1,13 @@
+{
+ "vptr": [
+ {
+ "@typeid": "TestObject",
+ "str": "type"
+ },
+ {
+ "flt": 3.14
+ },
+ null,
+ {}
+ ]
+}