summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2018-07-07 16:07:26 -0400
committerTavian Barnes <tavianator@tavianator.com>2018-07-07 16:07:26 -0400
commit1fbd9806320f6f7d23d5d49100dfa6cb322b68b5 (patch)
tree9c564425c8d9c3f6f61b580965bfe4f81bfe2fdb
parent30b48746565be758f7014dce9448d8e91febab60 (diff)
downloadbfs-1fbd9806320f6f7d23d5d49100dfa6cb322b68b5.tar.xz
tests: Add some more tests for broken symlinks
-rwxr-xr-xtests.sh45
-rw-r--r--tests/test_H_notdir.out1
-rw-r--r--tests/test_H_samefile_notdir.out1
-rw-r--r--tests/test_L_broken.out1
-rw-r--r--tests/test_L_notdir.out1
-rw-r--r--tests/test_L_samefile_broken.out1
-rw-r--r--tests/test_L_samefile_notdir.out1
-rw-r--r--tests/test_L_samefile_symlink.out3
-rw-r--r--tests/test_samefile_notdir.out1
9 files changed, 55 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index 1045e51..b74e067 100755
--- a/tests.sh
+++ b/tests.sh
@@ -190,8 +190,11 @@ posix_tests=(
test_H
test_H_slash
test_H_broken
+ test_H_notdir
test_H_newer
test_L
+ test_L_broken
+ test_L_notdir
test_L_depth
test_user_name
test_user_id
@@ -236,8 +239,13 @@ bsd_tests=(
test_samefile
test_samefile_symlink
test_H_samefile_symlink
+ test_L_samefile_symlink
test_samefile_broken
test_H_samefile_broken
+ test_L_samefile_broken
+ test_samefile_notdir
+ test_H_samefile_notdir
+ test_L_samefile_notdir
test_name_slash
test_name_slashes
test_iname
@@ -314,8 +322,13 @@ gnu_tests=(
test_samefile
test_samefile_symlink
test_H_samefile_symlink
+ test_L_samefile_symlink
test_samefile_broken
test_H_samefile_broken
+ test_L_samefile_broken
+ test_samefile_notdir
+ test_H_samefile_notdir
+ test_L_samefile_notdir
test_xtype_l
test_xtype_f
test_L_xtype_l
@@ -755,6 +768,10 @@ function test_H_broken() {
bfs_diff -H links/broken
}
+function test_H_notdir() {
+ bfs_diff -H links/notdir
+}
+
function test_H_newer() {
bfs_diff -H times -newer times/l
}
@@ -763,6 +780,14 @@ function test_L() {
bfs_diff -L links 2>/dev/null
}
+function test_L_broken() {
+ bfs_diff -H links/broken
+}
+
+function test_L_notdir() {
+ bfs_diff -H links/notdir
+}
+
function test_X() {
bfs_diff -X weirdnames 2>/dev/null
}
@@ -787,6 +812,10 @@ function test_H_samefile_symlink() {
bfs_diff -H links -samefile links/symlink
}
+function test_L_samefile_symlink() {
+ bfs_diff -L links -samefile links/symlink 2>/dev/null
+}
+
function test_samefile_broken() {
bfs_diff links -samefile links/broken
}
@@ -795,6 +824,22 @@ function test_H_samefile_broken() {
bfs_diff -H links -samefile links/broken
}
+function test_L_samefile_broken() {
+ bfs_diff -L links -samefile links/broken 2>/dev/null
+}
+
+function test_samefile_notdir() {
+ bfs_diff links -samefile links/notdir
+}
+
+function test_H_samefile_notdir() {
+ bfs_diff -H links -samefile links/notdir
+}
+
+function test_L_samefile_notdir() {
+ bfs_diff -L links -samefile links/notdir 2>/dev/null
+}
+
function test_xtype_l() {
bfs_diff links -xtype l 2>/dev/null
}
diff --git a/tests/test_H_notdir.out b/tests/test_H_notdir.out
new file mode 100644
index 0000000..6e6658d
--- /dev/null
+++ b/tests/test_H_notdir.out
@@ -0,0 +1 @@
+links/notdir
diff --git a/tests/test_H_samefile_notdir.out b/tests/test_H_samefile_notdir.out
new file mode 100644
index 0000000..6e6658d
--- /dev/null
+++ b/tests/test_H_samefile_notdir.out
@@ -0,0 +1 @@
+links/notdir
diff --git a/tests/test_L_broken.out b/tests/test_L_broken.out
new file mode 100644
index 0000000..21d6316
--- /dev/null
+++ b/tests/test_L_broken.out
@@ -0,0 +1 @@
+links/broken
diff --git a/tests/test_L_notdir.out b/tests/test_L_notdir.out
new file mode 100644
index 0000000..6e6658d
--- /dev/null
+++ b/tests/test_L_notdir.out
@@ -0,0 +1 @@
+links/notdir
diff --git a/tests/test_L_samefile_broken.out b/tests/test_L_samefile_broken.out
new file mode 100644
index 0000000..21d6316
--- /dev/null
+++ b/tests/test_L_samefile_broken.out
@@ -0,0 +1 @@
+links/broken
diff --git a/tests/test_L_samefile_notdir.out b/tests/test_L_samefile_notdir.out
new file mode 100644
index 0000000..6e6658d
--- /dev/null
+++ b/tests/test_L_samefile_notdir.out
@@ -0,0 +1 @@
+links/notdir
diff --git a/tests/test_L_samefile_symlink.out b/tests/test_L_samefile_symlink.out
new file mode 100644
index 0000000..222ac78
--- /dev/null
+++ b/tests/test_L_samefile_symlink.out
@@ -0,0 +1,3 @@
+links/file
+links/hardlink
+links/symlink
diff --git a/tests/test_samefile_notdir.out b/tests/test_samefile_notdir.out
new file mode 100644
index 0000000..6e6658d
--- /dev/null
+++ b/tests/test_samefile_notdir.out
@@ -0,0 +1 @@
+links/notdir