Skip to content

Commit 45ea578

Browse files
committed
Add a broken test that *should* pass. Will file a bug for it.
1 parent 200c37b commit 45ea578

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tdom/processor_test.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,15 @@ def test_interpolated_attribute_value_with_static_prefix_and_suffix():
506506
assert str(node) == '<div data-id="item-3-suffix"></div>'
507507

508508

509+
def test_attribute_value_empty_string():
510+
node = html(t'<div data-id=""></div>')
511+
assert node == Element(
512+
"div",
513+
attrs={"data-id": ""},
514+
children=[],
515+
)
516+
517+
509518
def test_interpolated_attribute_value_multiple_placeholders():
510519
start = 1
511520
end = 5
@@ -518,6 +527,18 @@ def test_interpolated_attribute_value_multiple_placeholders():
518527
assert str(node) == '<div data-range="1-5"></div>'
519528

520529

530+
def test_interpolated_attribute_value_tricky_multiple_placeholders():
531+
start = "start"
532+
end = "end"
533+
node = html(t'<div data-range="{start}5-and-{end}12"></div>')
534+
assert node == Element(
535+
"div",
536+
attrs={"data-range": "start5-and-end12"},
537+
children=[],
538+
)
539+
assert str(node) == '<div data-range="start5-and-end12"></div>'
540+
541+
521542
def test_interpolated_attribute_value_multiple_placeholders_no_quotes():
522543
start = 1
523544
end = 5

0 commit comments

Comments
 (0)