Skip to content

Commit d15e13c

Browse files
Test display control-only placeholder semantics
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 2a634c3 commit d15e13c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_display_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def test_format_string_key_for_error_returns_blank_fallback_for_empty_keys():
7373
assert format_string_key_for_error(" ", max_length=20) == "<blank key>"
7474

7575

76+
def test_format_string_key_for_error_preserves_placeholder_for_control_only_keys():
77+
assert format_string_key_for_error("\n\t\r", max_length=20) == "???"
78+
79+
7680
def test_format_string_key_for_error_supports_custom_blank_fallback():
7781
assert (
7882
format_string_key_for_error(" ", max_length=20, blank_fallback="<empty>")
@@ -126,3 +130,7 @@ def test_format_string_key_for_error_truncates_custom_blank_fallback():
126130
)
127131
== "... (truncated)"
128132
)
133+
134+
135+
def test_normalize_display_text_preserves_placeholder_for_control_only_values():
136+
assert normalize_display_text("\n\t\r", max_length=20) == "???"

0 commit comments

Comments
 (0)