Skip to content

Commit

Permalink
Add additional union tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johngrimes committed Jan 19, 2024
1 parent 47d7dd2 commit a1d4f48
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions tests/content/union_all.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,77 @@
]
},
"expect": [{ "family": "f1" }, { "family": "f1" }, { "family": "f2" }, { "family": "f3" }]
},
{
"title": "unionAll with one empty operand",
"view": {
"resource": "Patient",
"select": [
{
"unionAll": [
{
"forEach": "name.where(false)",
"column": [{ "path": "family", "name": "family" }]
},
{
"forEach": "contact.name",
"column": [{ "path": "family", "name": "family" }]
}
]
}
]
},
"expect": [{ "family": "f2" }, { "family": "f3" }]
},
{
"title": "unionAll with empty result",
"view": {
"resource": "Patient",
"select": [
{
"column": [
{
"path": "id",
"name": "id"
}
],
"unionAll": [
{
"forEach": "{}",
"column": [{ "path": "family", "name": "family" }]
}
]
}
]
},
"expect": []
},
{
"title": "unionAll with empty result and forEachOrNull",
"view": {
"resource": "Patient",
"select": [
{
"column": [
{
"path": "id",
"name": "id"
}
],
"unionAll": [
{
"forEachOrNull": "{}",
"column": [{ "path": "family", "name": "family" }]
},
{
"forEachOrNull": "{}",
"column": [{ "path": "family", "name": "family" }]
}
]
}
]
},
"expect": [{"id": "p1", "family": null},{"id": "p1", "family": null}]
}
]
}

0 comments on commit a1d4f48

Please sign in to comment.