From d3251ddd5d819050fd5e2e2079a56b336735f40b Mon Sep 17 00:00:00 2001 From: Glenn Jackman Date: Sat, 5 Dec 2026 08:29:31 -0500 Subject: [PATCH] Address messy-downloads review findings Add a sentence missing from the quoting concept's about.md, and test that task 1 preserves repeated spaces in the file name. Co-Authored-By: Claude Sonnet 5.5 --- concepts/quoting/about.md | 1 + .../concept/messy-downloads/messy_downloads.bats | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/concepts/quoting/about.md b/concepts/quoting/about.md index 3828cc65..0e09ca92 100644 --- a/concepts/quoting/about.md +++ b/concepts/quoting/about.md @@ -113,6 +113,7 @@ ls *.md ``` Filename expansion is a feature of the _shell_, not of the `ls` program. +Before it runs `ls`, bash replaces the pattern with the names of the matching files. If the directory contains `a.md` and `b.md`, then `ls` is run as `ls a.md b.md`: `ls` never sees the `*`. Every command gets the same treatment, which is why `echo *.md` prints the file names too. diff --git a/exercises/concept/messy-downloads/messy_downloads.bats b/exercises/concept/messy-downloads/messy_downloads.bats index 417d68a0..410534c9 100644 --- a/exercises/concept/messy-downloads/messy_downloads.bats +++ b/exercises/concept/messy-downloads/messy_downloads.bats @@ -32,6 +32,17 @@ test_looking_at_file_with_brackets() { # @test assert_line --index 0 'Looking at "notes [v2].txt"' } +# bats test_tags=task:1 +test_looking_at_file_with_repeated_spaces() { # @test + # Created in $BATS_TEST_TMPDIR (see setup), so bats cleans it up. + printf 'old news\n' > 'my old report.txt' + + run bash "$script" 'my old report.txt' 'txt' 'note' + + assert_success + assert_line --index 0 'Looking at "my old report.txt"' +} + # bats test_tags=task:2 test_contents_of_file_with_spaces() { # @test run bash "$script" 'my report.txt' 'txt' 'note'