summaryrefslogtreecommitdiff
path: root/lib/configuration/tests/configuration.t
diff options
context:
space:
mode:
Diffstat (limited to 'lib/configuration/tests/configuration.t')
-rw-r--r--lib/configuration/tests/configuration.t77
1 files changed, 77 insertions, 0 deletions
diff --git a/lib/configuration/tests/configuration.t b/lib/configuration/tests/configuration.t
new file mode 100644
index 0000000..a732db6
--- /dev/null
+++ b/lib/configuration/tests/configuration.t
@@ -0,0 +1,77 @@
+The configuration is written in JSON5 format.
+
+Minimal configuration file with nothing:
+
+ $ tests -configuration <<EOF
+ > { "content" : [] }
+ >
+ > EOF
+
+
+Trailing coma are accepted:
+
+ $ tests -configuration <<EOF
+ > { "content" :
+ > [
+ > {
+ > "id": "entity",
+ > },
+ > ]
+ > }
+ >
+ > EOF
+
+Comments are accepted:
+
+ $ tests -configuration <<EOF
+ > { "content" :
+ > [
+ > {
+ > // This is a comment in the file
+ > "id": "entity",
+ > }
+ > ]
+ > }
+ >
+ > EOF
+
+Cycles between elements are accepted when they are not mandatory to each other
+
+ $ tests -configuration <<EOF
+ > {
+ > "content": [
+ > {
+ > "id": "entity",
+ > "section": [
+ > {
+ > "field": [
+ > {
+ > "name": "user_type",
+ > "label": {},
+ > "type": {
+ > "content": "user",
+ > "multivaluated": true
+ > }
+ > }
+ > ]
+ > }
+ > ]
+ > },
+ > {
+ > "id": "user",
+ > "section": [
+ > {
+ > "field": [
+ > {
+ > "name": "entity",
+ > "label": {},
+ > "type": { "content": "entity", }
+ > }
+ > ]
+ > }
+ > ]
+ > }
+ > ]
+ > }
+
+