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'