summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-10-21 16:02:30 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-10-21 16:08:14 -0400
commit4a08c0300cf6b0ee3bb5f755007641635ba21f9d (patch)
tree4fcce4cf80bc6575eb053c6691398d04be1eb917 /tests.sh
parent4e38f139f92b8b3729f82c37f0904c2b77d3eb58 (diff)
downloadbfs-4a08c0300cf6b0ee3bb5f755007641635ba21f9d.tar.xz
parse: Keep track of what files are already open
Fixes #22
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests.sh b/tests.sh
index 0f52581..9775292 100755
--- a/tests.sh
+++ b/tests.sh
@@ -330,6 +330,7 @@ gnu_tests=(
test_flag_weird_names
test_follow_comma
test_fprint
+ test_fprint_duplicate
test_double_dash
test_flag_double_dash
test_ignore_readdir_race
@@ -931,16 +932,31 @@ function test_follow_comma() {
}
function test_fprint() {
+ invoke_bfs basic -fprint scratch/test_fprint.out
+ sort -o scratch/test_fprint.out scratch/test_fprint.out
+
if [ "$UPDATE" ]; then
- invoke_bfs basic -fprint "$TESTS/test_fprint.out"
- sort -o "$TESTS/test_fprint.out" "$TESTS/test_fprint.out"
+ cp scratch/test_fprint.out "$TESTS/test_fprint.out"
else
- invoke_bfs basic -fprint scratch/test_fprint.out
- sort -o scratch/test_fprint.out scratch/test_fprint.out
diff -u scratch/test_fprint.out "$TESTS/test_fprint.out"
fi
}
+function test_fprint_duplicate() {
+ touchp scratch/test_fprint_duplicate.out
+ ln scratch/test_fprint_duplicate.out scratch/test_fprint_duplicate.hard
+ ln -s test_fprint_duplicate.out scratch/test_fprint_duplicate.soft
+
+ invoke_bfs basic -fprint scratch/test_fprint_duplicate.out -fprint scratch/test_fprint_duplicate.hard -fprint scratch/test_fprint_duplicate.soft
+ sort -o scratch/test_fprint_duplicate.out scratch/test_fprint_duplicate.out
+
+ if [ "$UPDATE" ]; then
+ cp scratch/test_fprint_duplicate.out "$TESTS/test_fprint_duplicate.out"
+ else
+ diff -u scratch/test_fprint_duplicate.out "$TESTS/test_fprint_duplicate.out"
+ fi
+}
+
function test_double_dash() {
cd basic
bfs_diff -- . -type f