diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-11-21 11:23:41 +0100 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-11-21 11:23:41 +0100 |
| commit | ce13c93cf14cb71894481b0303a7058a72a6f4ce (patch) | |
| tree | bd93186a65f6645cb4401f188d266d743cc2fde7 /lib/query/tests/select.t | |
| parent | 172a02b80d8dbdcfe09129d7fa76015bb5ec4d79 (diff) | |
Load values from the database
Diffstat (limited to 'lib/query/tests/select.t')
| -rw-r--r-- | lib/query/tests/select.t | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/query/tests/select.t b/lib/query/tests/select.t new file mode 100644 index 0000000..f4a4740 --- /dev/null +++ b/lib/query/tests/select.t @@ -0,0 +1,48 @@ +Low level test of [Query.select]: two rows are inserted in the table of the +content given as argument (the configuration is read on the standard input), +then each row is read back with [Query.select]. One line is printed per field, +as received by the callback. The [id] of the row is the argument of [select]: +it is not reported by the callback. + + $ tests --select "entity" <<EOF + > { + > "list": [ + > { + > "id": "country_list", + > "field": [ + > { "name": "code", "label": {}, "type": "text" } + > ] + > } + > ], + > "content": [ + > { + > "id": "entity", + > "section": [ + > { + > "field": [ + > { "name": "name", "label": {}, "type": "text" }, + > { "name": "year", "label": {}, "type": "integer" }, + > { "name": "country", "label": {}, "type": { "content": "country_list" } }, + > { + > "name": "aliases", + > "label": {}, + > "type": { "content": "country_list", "multivaluated": true } + > } + > ] + > } + > ] + > } + > ] + > } + > EOF + row 1: + name = "name-1" + year = 1 + country -> 1 + aliases -> [1,2] + row 2: + name = "name-2" + year = 2 + country -> 1 + aliases -> [2] + |
