Skip to content

Commit 82d9d6b

Browse files
fix: add test that exercise all characters allowed in partial template names
1 parent dd66efb commit 82d9d6b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

spec/partials.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,22 @@
3434
content:
3535
[{ text: "Hello from a partial! This is the main template.\n" }]
3636

37-
# Tests partial inclusion with a dotted name (e.g., file.variant).
38-
- name: dotted_partial_name
37+
# Tests that partial names support the full filename regex: letters, digits,
38+
# underscores, hyphens, and dots (e.g., topic-2.sub_topic).
39+
- name: partial_name_with_full_regex
3940
template: |
40-
{{> greeting.in_french}} This is the main template.
41+
{{> topic-2.sub_topic}} This is the main template.
4142
partials:
42-
greeting.in_french: "Bonjour d'un partial!"
43+
topic-2.sub_topic: "Hello from a complex-named partial!"
4344
tests:
44-
- desc: renders a partial with a dotted name
45+
- desc: renders a partial whose name contains letters, digits, dots, underscores, and hyphens
4546
data:
4647
input: {}
4748
expect:
4849
messages:
4950
- role: user
5051
content:
51-
[{ text: "Bonjour d'un partial! This is the main template.\n" }]
52+
[{ text: "Hello from a complex-named partial! This is the main template.\n" }]
5253

5354
# Tests partial rendering with context variables passed from the main template.
5455
- name: partial_with_context

0 commit comments

Comments
 (0)