From 830e7c5d27d161b91402414e6ecd49f1ed818bfb Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 27 Mar 2026 08:48:05 +0100 Subject: Initial commit --- lib/configuration/tests/configuration.t | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 lib/configuration/tests/configuration.t (limited to 'lib/configuration/tests/configuration.t') 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 < { "content" : [] } + > + > EOF + + +Trailing coma are accepted: + + $ tests -configuration < { "content" : + > [ + > { + > "id": "entity", + > }, + > ] + > } + > + > EOF + +Comments are accepted: + + $ tests -configuration < { "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 < { + > "content": [ + > { + > "id": "entity", + > "section": [ + > { + > "field": [ + > { + > "name": "user_type", + > "label": {}, + > "type": { + > "content": "user", + > "multivaluated": true + > } + > } + > ] + > } + > ] + > }, + > { + > "id": "user", + > "section": [ + > { + > "field": [ + > { + > "name": "entity", + > "label": {}, + > "type": { "content": "entity", } + > } + > ] + > } + > ] + > } + > ] + > } + + -- cgit v1.2.3