Skip to content

Commit

Permalink
fix r4b liquid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Dec 3, 2024
1 parent af191fe commit 74a38e6
Showing 1 changed file with 57 additions and 2 deletions.
59 changes: 57 additions & 2 deletions r4b/liquid/liquid-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@
},{
"name" : "prepend",
"focus" : "Patient/example",
"template" : "{{Patient.id | prepend 'Patient-'}}",
"template" : "{{Patient.id || prepend: 'Patient-'}}",
"output" : "Patient-example"
},{
"name" : "if",
"focus" : "Patient/example",
"template" : "{% if Patient.id = 'example'%} yes {%else%} no {%endif%}",
"output" : " yes "
},{
"name" : "elsif",
"focus" : "Patient/example",
"template" : "{% if Patient.id = 'example'%} yes {%elsif Patient.id='none'%} ?? {%else%} no {%endif%}",
"output" : " yes "
},{
"name" : "loop",
"focus" : "Patient/example",
Expand All @@ -49,6 +54,56 @@
"output" : "ChalmersWindsor",
"includes" : {
"humanname.html" : "{{include.name.family}}"
}
}
},{
"name" : "for",
"focus" : "Patient/example",
"template" : "{%for name in Patient.name%}{{name.family}}{%endfor%} ",
"output" : "ChalmersWindsor "
},{
"name" : "forelse",
"focus" : "Patient/example",
"template" : "{%for link in Patient.link%}{{link.type}}{%else%}none{%endfor%}",
"output" : "none"
},{
"name" : "forcontinue",
"focus" : "Patient/example",
"template" : "{%for telecom in Patient.telecom%}{%if telecom.use = 'old'%}{%continue%}{%else%}{{telecom.value}}{%endif%}{%endfor%}",
"output" : "(03) 5555 6473(03) 3410 5613"
},{
"name" : "forbreak",
"focus" : "Patient/example",
"template" : "{%for telecom in Patient.telecom%}{%if telecom.rank = 2%}{%break%}{%else%}{{telecom.value}}{%endif%}{%endfor%}",
"output" : "(03) 5555 6473"
},{
"name" : "forcycle",
"focus" : "Patient/example",
"template" : "{%for telecom in Patient.telecom%}{%cycle \"odd\", \"even\"%}{%endfor%}",
"output" : "oddevenoddeven"
},{
"name" : "forlimit",
"focus" : "Patient/example",
"template" : "{%for telecom in Patient.telecom limit:2%}{{telecom.use}}{%endfor%}",
"output" : "homework"
},{
"name" : "foroffset",
"focus" : "Patient/example",
"template" : "{%for telecom in Patient.telecom offset:2%}{{telecom.use}}{%endfor%}",
"output" : "mobileold"
},{
"name" : "forreversed",
"focus" : "Patient/example",
"template" : "{%for telecom in Patient.telecom reversed%}{{telecom.use}}{%endfor%}",
"output" : "oldmobileworkhome"
},{
"name" : "assign1",
"focus" : "Patient/example",
"template" : "{% assign foo = \"bar\" %}{{ foo }}",
"output" : "bar"
},{
"name" : "assign2",
"focus" : "Patient/example",
"template" : "{% assign my_variable = false %}{% if my_variable != true %}This statement is valid.{% endif %}",
"output" : "This statement is valid."
}]
}

0 comments on commit 74a38e6

Please sign in to comment.