summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-09-02 15:34:32 -0400
committerTavian Barnes <tavianator@tavianator.com>2017-09-02 15:34:32 -0400
commit2741f580ffb6a05f52f0e2b05fa77ff3a15d967f (patch)
treea89624d55c79f91807ed89988271c31b5bce6fc6
parente5627cd680838ad2217d4ba107a7e6d9aff26c2c (diff)
downloadbfs-2741f580ffb6a05f52f0e2b05fa77ff3a15d967f.tar.xz
tests: Use human-readable filenames in links/
-rwxr-xr-xtests.sh53
-rw-r--r--tests/test_H.out2
-rw-r--r--tests/test_H_broken.out2
-rw-r--r--tests/test_H_samefile_broken.out2
-rw-r--r--tests/test_H_samefile_symlink.out4
-rw-r--r--tests/test_H_slash.out2
-rw-r--r--tests/test_L.out23
-rw-r--r--tests/test_L_depth.out23
-rw-r--r--tests/test_L_ilname.out2
-rw-r--r--tests/test_L_lname.out2
-rw-r--r--tests/test_L_xtype_f.out4
-rw-r--r--tests/test_L_xtype_l.out11
-rw-r--r--tests/test_P.out2
-rw-r--r--tests/test_P_slash.out2
-rw-r--r--tests/test_colors.out21
-rw-r--r--tests/test_expr_flag_path.out3
-rw-r--r--tests/test_expr_path_flag.out3
-rw-r--r--tests/test_flag_expr_path.out3
-rw-r--r--tests/test_follow.out23
-rw-r--r--tests/test_ilname.out2
-rw-r--r--tests/test_links.out4
-rw-r--r--tests/test_links_plus.out4
-rw-r--r--tests/test_lname.out2
-rw-r--r--tests/test_path_expr_flag.out3
-rw-r--r--tests/test_path_flag_expr.out3
-rw-r--r--tests/test_printf_types.out21
-rw-r--r--tests/test_samefile.out4
-rw-r--r--tests/test_samefile_broken.out2
-rw-r--r--tests/test_samefile_symlink.out2
-rw-r--r--tests/test_type_multi.out10
-rw-r--r--tests/test_xtype_f.out6
-rw-r--r--tests/test_xtype_l.out4
-rw-r--r--tests/test_xtype_multi.out16
33 files changed, 128 insertions, 142 deletions
diff --git a/tests.sh b/tests.sh
index a23b5bb..911bfcd 100755
--- a/tests.sh
+++ b/tests.sh
@@ -72,14 +72,15 @@ make_perms "$TMP/perms"
# Creates a file+directory structure with various symbolic and hard links
function make_links() {
- touchp "$1/a"
- ln -s a "$1/b"
- ln "$1/a" "$1/c"
- mkdir -p "$1/d/e/f"
- ln -s ../../d "$1/d/e/g"
- ln -s d/e "$1/h"
- ln -s q "$1/d/e/i"
- ln -s b/c "$1/j"
+ touchp "$1/file"
+ ln -s file "$1/symlink"
+ ln "$1/file" "$1/hardlink"
+ ln -s nowhere "$1/broken"
+ ln -s symlink/file "$1/notdir"
+ ln -s loop "$1/loop"
+ mkdir -p "$1/deeply/nested/dir"
+ ln -s ../../deeply "$1/deeply/nested/loop"
+ ln -s deeply/nested/loop/nested "$1/skip"
}
make_links "$TMP/links"
@@ -673,23 +674,23 @@ function test_links_minus() {
}
function test_P() {
- bfs_diff -P links/d/e/f
+ bfs_diff -P links/deeply/nested/dir
}
function test_P_slash() {
- bfs_diff -P links/d/e/f/
+ bfs_diff -P links/deeply/nested/dir/
}
function test_H() {
- bfs_diff -H links/d/e/f
+ bfs_diff -H links/deeply/nested/dir
}
function test_H_slash() {
- bfs_diff -H links/d/e/f/
+ bfs_diff -H links/deeply/nested/dir/
}
function test_H_broken() {
- bfs_diff -H links/d/e/i
+ bfs_diff -H links/broken
}
function test_H_newer() {
@@ -713,31 +714,31 @@ function test_L_depth() {
}
function test_samefile() {
- bfs_diff links -samefile links/a
+ bfs_diff links -samefile links/file
}
function test_samefile_symlink() {
- bfs_diff links -samefile links/b
+ bfs_diff links -samefile links/symlink
}
function test_H_samefile_symlink() {
- bfs_diff -H links -samefile links/b
+ bfs_diff -H links -samefile links/symlink
}
function test_samefile_broken() {
- bfs_diff links -samefile links/d/e/i
+ bfs_diff links -samefile links/broken
}
function test_H_samefile_broken() {
- bfs_diff -H links -samefile links/d/e/i
+ bfs_diff -H links -samefile links/broken
}
function test_xtype_l() {
- bfs_diff links -xtype l
+ bfs_diff links -xtype l 2>/dev/null
}
function test_xtype_f() {
- bfs_diff links -xtype f
+ bfs_diff links -xtype f 2>/dev/null
}
function test_L_xtype_l() {
@@ -749,7 +750,7 @@ function test_L_xtype_f() {
}
function test_xtype_multi() {
- bfs_diff links -xtype f,d,c
+ bfs_diff links -xtype f,d,c 2>/dev/null
}
function test_iname() {
@@ -1244,23 +1245,23 @@ function test_fstype() {
}
function test_path_flag_expr() {
- bfs_diff links/h -H -type l
+ bfs_diff links/skip -H -type l
}
function test_path_expr_flag() {
- bfs_diff links/h -type l -H
+ bfs_diff links/skip -type l -H
}
function test_flag_expr_path() {
- bfs_diff -H -type l links/h
+ bfs_diff -H -type l links/skip
}
function test_expr_flag_path() {
- bfs_diff -type l -H links/h
+ bfs_diff -type l -H links/skip
}
function test_expr_path_flag() {
- bfs_diff -type l links/h -H
+ bfs_diff -type l links/skip -H
}
function test_parens() {
diff --git a/tests/test_H.out b/tests/test_H.out
index a4beda4..ff635ff 100644
--- a/tests/test_H.out
+++ b/tests/test_H.out
@@ -1 +1 @@
-links/d/e/f
+links/deeply/nested/dir
diff --git a/tests/test_H_broken.out b/tests/test_H_broken.out
index e5e13fc..21d6316 100644
--- a/tests/test_H_broken.out
+++ b/tests/test_H_broken.out
@@ -1 +1 @@
-links/d/e/i
+links/broken
diff --git a/tests/test_H_samefile_broken.out b/tests/test_H_samefile_broken.out
index e5e13fc..21d6316 100644
--- a/tests/test_H_samefile_broken.out
+++ b/tests/test_H_samefile_broken.out
@@ -1 +1 @@
-links/d/e/i
+links/broken
diff --git a/tests/test_H_samefile_symlink.out b/tests/test_H_samefile_symlink.out
index 892c879..996ffc8 100644
--- a/tests/test_H_samefile_symlink.out
+++ b/tests/test_H_samefile_symlink.out
@@ -1,2 +1,2 @@
-links/a
-links/c
+links/file
+links/hardlink
diff --git a/tests/test_H_slash.out b/tests/test_H_slash.out
index 0a4fc77..df7701b 100644
--- a/tests/test_H_slash.out
+++ b/tests/test_H_slash.out
@@ -1 +1 @@
-links/d/e/f/
+links/deeply/nested/dir/
diff --git a/tests/test_L.out b/tests/test_L.out
index f9ded0a..dc88380 100644
--- a/tests/test_L.out
+++ b/tests/test_L.out
@@ -1,13 +1,12 @@
links
-links/a
-links/b
-links/c
-links/d
-links/h
-links/j
-links/d/e
-links/h/f
-links/h/g
-links/h/i
-links/d/e/f
-links/d/e/i
+links/broken
+links/deeply
+links/file
+links/hardlink
+links/notdir
+links/skip
+links/symlink
+links/deeply/nested
+links/skip/dir
+links/skip/loop
+links/deeply/nested/dir
diff --git a/tests/test_L_depth.out b/tests/test_L_depth.out
index f9ded0a..dc88380 100644
--- a/tests/test_L_depth.out
+++ b/tests/test_L_depth.out
@@ -1,13 +1,12 @@
links
-links/a
-links/b
-links/c
-links/d
-links/h
-links/j
-links/d/e
-links/h/f
-links/h/g
-links/h/i
-links/d/e/f
-links/d/e/i
+links/broken
+links/deeply
+links/file
+links/hardlink
+links/notdir
+links/skip
+links/symlink
+links/deeply/nested
+links/skip/dir
+links/skip/loop
+links/deeply/nested/dir
diff --git a/tests/test_L_ilname.out b/tests/test_L_ilname.out
index b7e42dd..e69de29 100644
--- a/tests/test_L_ilname.out
+++ b/tests/test_L_ilname.out
@@ -1,2 +0,0 @@
-links/h/i
-links/d/e/i
diff --git a/tests/test_L_lname.out b/tests/test_L_lname.out
index b7e42dd..e69de29 100644
--- a/tests/test_L_lname.out
+++ b/tests/test_L_lname.out
@@ -1,2 +0,0 @@
-links/h/i
-links/d/e/i
diff --git a/tests/test_L_xtype_f.out b/tests/test_L_xtype_f.out
index 892c879..996ffc8 100644
--- a/tests/test_L_xtype_f.out
+++ b/tests/test_L_xtype_f.out
@@ -1,2 +1,2 @@
-links/a
-links/c
+links/file
+links/hardlink
diff --git a/tests/test_L_xtype_l.out b/tests/test_L_xtype_l.out
index 57bee1b..5773878 100644
--- a/tests/test_L_xtype_l.out
+++ b/tests/test_L_xtype_l.out
@@ -1,6 +1,5 @@
-links/b
-links/h
-links/j
-links/h/g
-links/h/i
-links/d/e/i
+links/broken
+links/notdir
+links/skip
+links/symlink
+links/skip/loop
diff --git a/tests/test_P.out b/tests/test_P.out
index a4beda4..ff635ff 100644
--- a/tests/test_P.out
+++ b/tests/test_P.out
@@ -1 +1 @@
-links/d/e/f
+links/deeply/nested/dir
diff --git a/tests/test_P_slash.out b/tests/test_P_slash.out
index 0a4fc77..df7701b 100644
--- a/tests/test_P_slash.out
+++ b/tests/test_P_slash.out
@@ -1 +1 @@
-links/d/e/f/
+links/deeply/nested/dir/
diff --git a/tests/test_colors.out b/tests/test_colors.out
index 8c8b244..6f8c534 100644
--- a/tests/test_colors.out
+++ b/tests/test_colors.out
@@ -1,11 +1,12 @@
links
-links/d
-links/b
-links/h
-links/j
-links/a
-links/c
-links/d/e
-links/d/e/f
-links/d/e/g
-links/d/e/i
+links/deeply
+links/skip
+links/symlink
+links/broken
+links/loop
+links/notdir
+links/file
+links/hardlink
+links/deeply/nested
+links/deeply/nested/dir
+links/deeply/nested/loop
diff --git a/tests/test_expr_flag_path.out b/tests/test_expr_flag_path.out
index c774fb9..c37a541 100644
--- a/tests/test_expr_flag_path.out
+++ b/tests/test_expr_flag_path.out
@@ -1,2 +1 @@
-links/h/g
-links/h/i
+links/skip/loop
diff --git a/tests/test_expr_path_flag.out b/tests/test_expr_path_flag.out
index c774fb9..c37a541 100644
--- a/tests/test_expr_path_flag.out
+++ b/tests/test_expr_path_flag.out
@@ -1,2 +1 @@
-links/h/g
-links/h/i
+links/skip/loop
diff --git a/tests/test_flag_expr_path.out b/tests/test_flag_expr_path.out
index c774fb9..c37a541 100644
--- a/tests/test_flag_expr_path.out
+++ b/tests/test_flag_expr_path.out
@@ -1,2 +1 @@
-links/h/g
-links/h/i
+links/skip/loop
diff --git a/tests/test_follow.out b/tests/test_follow.out
index f9ded0a..dc88380 100644
--- a/tests/test_follow.out
+++ b/tests/test_follow.out
@@ -1,13 +1,12 @@
links
-links/a
-links/b
-links/c
-links/d
-links/h
-links/j
-links/d/e
-links/h/f
-links/h/g
-links/h/i
-links/d/e/f
-links/d/e/i
+links/broken
+links/deeply
+links/file
+links/hardlink
+links/notdir
+links/skip
+links/symlink
+links/deeply/nested
+links/skip/dir
+links/skip/loop
+links/deeply/nested/dir
diff --git a/tests/test_ilname.out b/tests/test_ilname.out
index 45cc127..e69de29 100644
--- a/tests/test_ilname.out
+++ b/tests/test_ilname.out
@@ -1,2 +0,0 @@
-links/b
-links/d/e/i
diff --git a/tests/test_links.out b/tests/test_links.out
index 892c879..996ffc8 100644
--- a/tests/test_links.out
+++ b/tests/test_links.out
@@ -1,2 +1,2 @@
-links/a
-links/c
+links/file
+links/hardlink
diff --git a/tests/test_links_plus.out b/tests/test_links_plus.out
index 892c879..996ffc8 100644
--- a/tests/test_links_plus.out
+++ b/tests/test_links_plus.out
@@ -1,2 +1,2 @@
-links/a
-links/c
+links/file
+links/hardlink
diff --git a/tests/test_lname.out b/tests/test_lname.out
index 45cc127..e69de29 100644
--- a/tests/test_lname.out
+++ b/tests/test_lname.out
@@ -1,2 +0,0 @@
-links/b
-links/d/e/i
diff --git a/tests/test_path_expr_flag.out b/tests/test_path_expr_flag.out
index c774fb9..c37a541 100644
--- a/tests/test_path_expr_flag.out
+++ b/tests/test_path_expr_flag.out
@@ -1,2 +1 @@
-links/h/g
-links/h/i
+links/skip/loop
diff --git a/tests/test_path_flag_expr.out b/tests/test_path_flag_expr.out
index c774fb9..c37a541 100644
--- a/tests/test_path_flag_expr.out
+++ b/tests/test_path_flag_expr.out
@@ -1,2 +1 @@
-links/h/g
-links/h/i
+links/skip/loop
diff --git a/tests/test_printf_types.out b/tests/test_printf_types.out
index bd89b47..b548b10 100644
--- a/tests/test_printf_types.out
+++ b/tests/test_printf_types.out
@@ -1,11 +1,12 @@
(links) () d d
-(links/a) () f f
-(links/b) (a) l f
-(links/c) () f f
-(links/d) () d d
-(links/d/e) () d d
-(links/h) (d/e) l d
-(links/j) (b/c) l N
-(links/d/e/f) () d d
-(links/d/e/i) (q) l N
-(links/d/e/g) (../../d) l d
+(links/broken) (nowhere) l N
+(links/deeply) () d d
+(links/file) () f f
+(links/hardlink) () f f
+(links/loop) (loop) l L
+(links/symlink) (file) l f
+(links/deeply/nested) () d d
+(links/notdir) (symlink/file) l N
+(links/deeply/nested/dir) () d d
+(links/skip) (deeply/nested/loop/nested) l d
+(links/deeply/nested/loop) (../../deeply) l d
diff --git a/tests/test_samefile.out b/tests/test_samefile.out
index 892c879..996ffc8 100644
--- a/tests/test_samefile.out
+++ b/tests/test_samefile.out
@@ -1,2 +1,2 @@
-links/a
-links/c
+links/file
+links/hardlink
diff --git a/tests/test_samefile_broken.out b/tests/test_samefile_broken.out
index e5e13fc..21d6316 100644
--- a/tests/test_samefile_broken.out
+++ b/tests/test_samefile_broken.out
@@ -1 +1 @@
-links/d/e/i
+links/broken
diff --git a/tests/test_samefile_symlink.out b/tests/test_samefile_symlink.out
index 76696d9..299a572 100644
--- a/tests/test_samefile_symlink.out
+++ b/tests/test_samefile_symlink.out
@@ -1 +1 @@
-links/b
+links/symlink
diff --git a/tests/test_type_multi.out b/tests/test_type_multi.out
index 1f94970..316ab7f 100644
--- a/tests/test_type_multi.out
+++ b/tests/test_type_multi.out
@@ -1,6 +1,6 @@
links
-links/a
-links/c
-links/d
-links/d/e
-links/d/e/f
+links/deeply
+links/file
+links/hardlink
+links/deeply/nested
+links/deeply/nested/dir
diff --git a/tests/test_xtype_f.out b/tests/test_xtype_f.out
index 2a65132..222ac78 100644
--- a/tests/test_xtype_f.out
+++ b/tests/test_xtype_f.out
@@ -1,3 +1,3 @@
-links/a
-links/b
-links/c
+links/file
+links/hardlink
+links/symlink
diff --git a/tests/test_xtype_l.out b/tests/test_xtype_l.out
index 2d1293f..8b0a404 100644
--- a/tests/test_xtype_l.out
+++ b/tests/test_xtype_l.out
@@ -1,2 +1,2 @@
-links/j
-links/d/e/i
+links/broken
+links/notdir
diff --git a/tests/test_xtype_multi.out b/tests/test_xtype_multi.out
index 8849bb9..f9847db 100644
--- a/tests/test_xtype_multi.out
+++ b/tests/test_xtype_multi.out
@@ -1,9 +1,9 @@
links
-links/a
-links/b
-links/c
-links/d
-links/h
-links/d/e
-links/d/e/f
-links/d/e/g
+links/deeply
+links/file
+links/hardlink
+links/skip
+links/symlink
+links/deeply/nested
+links/deeply/nested/dir
+links/deeply/nested/loop