diff options
| author | Sébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2023-12-07 12:22:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-07 12:22:07 +0100 |
| commit | 3e96f5f75fe4a63d868365bda91723b59c138814 (patch) | |
| tree | 96c7becbc7e9cd1d27b79f87441ff5f7e49a0d3f /tests/typ | |
| parent | 0bdd2191c073c1ecad29d71a55f81078e9e5f6ac (diff) | |
Fix label in `.fields()` accessor (#2884)
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/bugs/label-fields-dict.typ | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/typ/bugs/label-fields-dict.typ b/tests/typ/bugs/label-fields-dict.typ new file mode 100644 index 00000000..05c7006a --- /dev/null +++ b/tests/typ/bugs/label-fields-dict.typ @@ -0,0 +1,31 @@ +// Tests whether the label is accessible through the has, field, +// and fields accessors +// Ref: false + +--- +// Test whether the label is accessible through the has method +#show heading: it => { + assert(it.has("label")) + it +} + += Hello, world! <my_label> + +--- +// Test whether the label is accessible through the field method +#show heading: it => { + assert(str(it.label) == "my_label") + it +} + += Hello, world! <my_label> + +--- +// Test whether the label is accessible through the fields method +#show heading: it => { + assert("label" in it.fields()) + assert(str(it.fields().label) == "my_label") + it +} + += Hello, world! <my_label> |
