From fca6373c22c5995bd543fa7fa895172733d54895 Mon Sep 17 00:00:00 2001 From: ZeroRin Date: Wed, 30 Nov 2022 15:30:23 +0800 Subject: [PATCH] fix crlf test --- tests/git-auto-commit.bats | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/git-auto-commit.bats b/tests/git-auto-commit.bats index 92a3434..3993efc 100644 --- a/tests/git-auto-commit.bats +++ b/tests/git-auto-commit.bats @@ -982,15 +982,15 @@ cat_github_output() { assert_line "true" # Add more .txt files - touch "${FAKE_LOCAL_REPOSITORY}"/new-file-2.txt - touch "${FAKE_LOCAL_REPOSITORY}"/new-file-3.txt + echo -ne "crlf test1\r\n" > "${FAKE_LOCAL_REPOSITORY}"/new-file-2.txt + echo -ne "crlf test1\n" > "${FAKE_LOCAL_REPOSITORY}"/new-file-3.txt # Run git-auto-commit to add new files to repository run git_auto_commit # Change control characters in files - sed 's/^M$//' "${FAKE_LOCAL_REPOSITORY}"/new-file-2.txt - sed 's/$/^M/' "${FAKE_LOCAL_REPOSITORY}"/new-file-3.txt + echo -ne "crlf test1\n" > "${FAKE_LOCAL_REPOSITORY}"/new-file-2.txt + echo -ne "crlf test1\r\n" > "${FAKE_LOCAL_REPOSITORY}"/new-file-3.txt # Run git-auto-commit to commit the 2 changes files run git_auto_commit @@ -998,10 +998,8 @@ cat_github_output() { assert_success # Changes are not detected - assert_line --partial "Working tree clean. Nothing to commit." - - refute_line --partial "new-file-2.txt" - refute_line --partial "new-file-3.txt" + run cat_github_output + assert_line "changes_detected=false" }