Skip to content

Commit 9d0ce06

Browse files
committed
Keep permission testing.
1 parent 8249ca9 commit 9d0ce06

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

‎tests/run.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,18 @@ echo "Now diffing: git diff $clean_log > $final_diff"
5353
git diff $clean_log > $final_diff
5454

5555
if [ ! -s "$final_diff" ]; then
56+
echo
5657
echo "Success! No differences found."
5758
exit 0
5859
else
60+
echo
5961
echo "Warning: Differences detected:"
62+
echo "----------------------------------------"
6063
cat $final_diff
61-
echo "Review and fix or commit the new $clean_log file if it is correct."
64+
echo "----------------------------------------"
65+
echo
66+
echo "Tests did not pass!"
67+
echo "Review the diffs above, then fix or commit the new $clean_log file if it is correct."
6268

6369
exit 1
6470
fi

‎tests/tests-clean.log‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Read 1 files (0 chars), found 0 matches (0 skipped due to overlaps)
8282
Dry run: Would have changed 1 files (0 rewritten and 1 renamed)
8383

8484
ls_portable test2
85-
humpty-dumpty.txt
86-
stuff/
85+
-rw-r--r-- humpty-dumpty.txt
86+
drwxr-xr-x stuff/
8787

8888
run --renames --from humpty --to dumpty test2
8989
Using 1 patterns:
@@ -94,8 +94,8 @@ Read 1 files (0 chars), found 0 matches (0 skipped due to overlaps)
9494
Changed 1 files (0 rewritten and 1 renamed)
9595

9696
ls_portable test2
97-
dumpty-dumpty.txt
98-
stuff/
97+
-rw-r--r-- dumpty-dumpty.txt
98+
drwxr-xr-x stuff/
9999

100100
diff -r original test2 || expect_error
101101
Only in test2: dumpty-dumpty.txt
@@ -118,8 +118,8 @@ Read 12 files (3810 chars), found 3 matches (0 skipped due to overlaps)
118118
Dry run: Would have changed 1 files (1 rewritten and 1 renamed)
119119

120120
ls_portable test3
121-
humpty-dumpty.txt
122-
stuff/
121+
-rw-r--r-- humpty-dumpty.txt
122+
drwxr-xr-x stuff/
123123

124124
run --full -i --from humpty --to dumpty test3
125125
Using 1 patterns:
@@ -131,9 +131,9 @@ Read 12 files (3810 chars), found 3 matches (0 skipped due to overlaps)
131131
Changed 1 files (1 rewritten and 1 renamed)
132132

133133
ls_portable test3
134-
dumpty-dumpty.txt
135-
humpty-dumpty.txt.orig
136-
stuff/
134+
-rw-r--r-- dumpty-dumpty.txt
135+
-rw-r--r-- humpty-dumpty.txt.orig
136+
drwxr-xr-x stuff/
137137

138138
diff -r original test3 || expect_error
139139
Only in test3: dumpty-dumpty.txt

‎tests/tests.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ expect_error() {
2323
}
2424

2525
# A trick to do ls portably, showing just files and types.
26+
# Macos appends an @ to permissions, so we strip it.
2627
ls_portable() {
27-
ls -1F "$@"
28+
ls -lF "$@" | tail -n +2 | awk '{gsub(/@/, "", $1); print $1, $NF}'
2829
}
2930

3031
# This will echo all commands as they are read. Bash commands plus their

0 commit comments

Comments
 (0)