File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ text_format() {
421421 }
422422 notify_message () {
423423 local message=" $1 "
424- [[ -z " $message " ]] || printf -- " %s \n" " $message "
424+ [[ -z " $message " ]] || printf -- " %b \n" " $message "
425425 }
426426
427427 notify_stdout () {
@@ -475,7 +475,7 @@ tap_format() {
475475 }
476476 notify_message () {
477477 local message=" $1 "
478- [[ -z " $message " ]] || printf -- " %s \n" " $message " | " $SED " -u -e ' s/^/# /'
478+ [[ -z " $message " ]] || printf -- " %b \n" " $message " | " $SED " -u -e ' s/^/# /'
479479 }
480480 notify_stdout () {
481481 " $SED " ' s:^:# out> :' | color " $GREEN "
Original file line number Diff line number Diff line change @@ -221,16 +221,16 @@ test_notify_message_handles_percent_signs_as_literal_text_tap_format() {
221221 assert_equals " # Expected 100% but got 50%" " $bash_unit_output "
222222}
223223
224- test_notify_message_handles_unicode_escape_sequences_as_literal_text () {
225- # Test that printf in notify_message doesn't interpret escape sequences
226- bash_unit_output=$( $BASH_UNIT <( printf ' %s\n' ' test_escape() { fail "Symbol: \u2713\nshould be literal " ; }' ) 2>&1 | " $GREP " ' Symbol: ' )
227- assert_matches ' \\u2713\\nshould ' " $bash_unit_output "
224+ test_notify_message_renders_unicode_characters_correctly () {
225+ # Test that notify_message properly interprets Unicode escape sequences and newlines
226+ bash_unit_output=$( $BASH_UNIT <( printf ' %s\n' ' test_escape() { fail "Symbol: \u2713\nMultiline message " ; }' ) 2>&1 || : )
227+ assert_matches " Symbol: ✓ " $' \n ' " Multiline message " " $bash_unit_output "
228228}
229229
230- test_notify_message_handles_unicode_escape_sequences_as_literal_text_tap_format () {
231- # Test that printf in notify_message doesn't interpret escape sequences
232- bash_unit_output=$( $BASH_UNIT -f tap <( printf ' %s\n' ' test_escape() { fail "Symbol: \u2713\nshould be literal " ; }' ) 2>&1 | " $GREP " ' Symbol: ' )
233- assert_matches ' \\u2713\\nshould ' " $bash_unit_output "
230+ test_notify_message_renders_unicode_characters_correctly_tap_format () {
231+ # Test that notify_message properly interprets Unicode escape sequences and newlines in TAP format
232+ bash_unit_output=$( $BASH_UNIT -f tap <( printf ' %s\n' ' test_escape() { fail "Symbol: \u2713\nMultiline message " ; }' ) 2>&1 || : )
233+ assert_matches " # Symbol: ✓ " $' \n ' " # Multiline message " " $bash_unit_output "
234234}
235235
236236setup () {
You can’t perform that action at this time.
0 commit comments