t3905: use test_cmp() to check file contents

Modernize the script by doing file content comparisons using test_cmp()
instead of `test x = "$(cat file)"`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Denton Liu 2021-02-08 23:28:52 -08:00 коммит произвёл Junio C Hamano
Родитель 27e25a8cbf
Коммит 8c2462d1fe
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -103,8 +103,10 @@ test_expect_success 'stash pop after save --include-untracked leaves files untra
git stash pop &&
git status --porcelain >actual &&
test_cmp expect actual &&
test "1" = "$(cat file2)" &&
test untracked = "$(cat untracked/untracked)"
echo 1 >expect_file2 &&
test_cmp expect_file2 file2 &&
echo untracked >untracked_expect &&
test_cmp untracked_expect untracked/untracked
'
test_expect_success 'clean up untracked/ directory to prepare for next tests' '