diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-11-14 00:08:11 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-11-14 00:08:11 -0500 |
commit | a8f7b6dbd743bc224e2a8616993c373e82072956 (patch) | |
tree | 4f1485d9ebea1bca3e8105f9a049169aa45f0aab /tests | |
parent | 4b60aafc1185164cf48a0627bc3b092c6a79b3bc (diff) | |
download | bfs-a8f7b6dbd743bc224e2a8616993c373e82072956.tar.xz |
tests: Don't assume find continues after filesystem loops
POSIX says
> When it detects an infinite loop, find shall write a diagnostic
> message to standard error and shall either recover its position in the
> hierarchy or terminate.
So make the 'links' folder not have any loops, and add a new 'loops'
folder for testing the GNU/bfs behaviour.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_H_loops.out | 4 | ||||
-rw-r--r-- | tests/test_L.out | 5 | ||||
-rw-r--r-- | tests/test_L_depth.out | 5 | ||||
-rw-r--r-- | tests/test_L_loops_continue.out | 11 | ||||
-rw-r--r-- | tests/test_L_xtype_f.out | 2 | ||||
-rw-r--r-- | tests/test_L_xtype_l.out | 3 | ||||
-rw-r--r-- | tests/test_colors.out | 4 | ||||
-rw-r--r-- | tests/test_expr_flag_path.out | 2 | ||||
-rw-r--r-- | tests/test_expr_path_flag.out | 2 | ||||
-rw-r--r-- | tests/test_flag_expr_path.out | 2 | ||||
-rw-r--r-- | tests/test_follow.out | 5 | ||||
-rw-r--r-- | tests/test_links_minus.out | 1 | ||||
-rw-r--r-- | tests/test_path_expr_flag.out | 2 | ||||
-rw-r--r-- | tests/test_path_flag_expr.out | 2 | ||||
-rw-r--r-- | tests/test_printf_types.out | 23 | ||||
-rw-r--r-- | tests/test_type_multi.out | 1 | ||||
-rw-r--r-- | tests/test_xtype_f.out | 2 | ||||
-rw-r--r-- | tests/test_xtype_multi.out | 3 |
18 files changed, 55 insertions, 24 deletions
diff --git a/tests/test_H_loops.out b/tests/test_H_loops.out new file mode 100644 index 0000000..1fc8f8f --- /dev/null +++ b/tests/test_H_loops.out @@ -0,0 +1,4 @@ +loops/deeply/nested/loop +loops/deeply/nested/loop/nested +loops/deeply/nested/loop/nested/dir +loops/deeply/nested/loop/nested/loop diff --git a/tests/test_L.out b/tests/test_L.out index dc88380..cf21a44 100644 --- a/tests/test_L.out +++ b/tests/test_L.out @@ -8,5 +8,8 @@ links/skip links/symlink links/deeply/nested links/skip/dir -links/skip/loop +links/skip/file +links/skip/link links/deeply/nested/dir +links/deeply/nested/file +links/deeply/nested/link diff --git a/tests/test_L_depth.out b/tests/test_L_depth.out index dc88380..cf21a44 100644 --- a/tests/test_L_depth.out +++ b/tests/test_L_depth.out @@ -8,5 +8,8 @@ links/skip links/symlink links/deeply/nested links/skip/dir -links/skip/loop +links/skip/file +links/skip/link links/deeply/nested/dir +links/deeply/nested/file +links/deeply/nested/link diff --git a/tests/test_L_loops_continue.out b/tests/test_L_loops_continue.out new file mode 100644 index 0000000..fbe0cac --- /dev/null +++ b/tests/test_L_loops_continue.out @@ -0,0 +1,11 @@ +loops +loops/broken +loops/deeply +loops/file +loops/notdir +loops/skip +loops/symlink +loops/deeply/nested +loops/skip/dir +loops/skip/loop +loops/deeply/nested/dir diff --git a/tests/test_L_xtype_f.out b/tests/test_L_xtype_f.out index 996ffc8..78953d1 100644 --- a/tests/test_L_xtype_f.out +++ b/tests/test_L_xtype_f.out @@ -1,2 +1,4 @@ links/file links/hardlink +links/skip/file +links/deeply/nested/file diff --git a/tests/test_L_xtype_l.out b/tests/test_L_xtype_l.out index 5773878..1cb0e19 100644 --- a/tests/test_L_xtype_l.out +++ b/tests/test_L_xtype_l.out @@ -2,4 +2,5 @@ links/broken links/notdir links/skip links/symlink -links/skip/loop +links/skip/link +links/deeply/nested/link diff --git a/tests/test_colors.out b/tests/test_colors.out index 6f8c534..8f09546 100644 --- a/tests/test_colors.out +++ b/tests/test_colors.out @@ -3,10 +3,10 @@ [01;34mlinks/[0m[01;36mskip[0m [01;34mlinks/[0m[01;36msymlink[0m [01;34mlinks/[0m[40;31;01mbroken[0m -[01;34mlinks/[0m[40;31;01mloop[0m [01;34mlinks/[0m[40;31;01mnotdir[0m [01;34mlinks/[0mfile [01;34mlinks/[0mhardlink [01;34mlinks/deeply/[0m[01;34mnested[0m [01;34mlinks/deeply/nested/[0m[01;34mdir[0m -[01;34mlinks/deeply/nested/[0m[01;36mloop[0m +[01;34mlinks/deeply/nested/[0m[01;36mlink[0m +[01;34mlinks/deeply/nested/[0mfile diff --git a/tests/test_expr_flag_path.out b/tests/test_expr_flag_path.out index c37a541..3112cd2 100644 --- a/tests/test_expr_flag_path.out +++ b/tests/test_expr_flag_path.out @@ -1 +1 @@ -links/skip/loop +links/skip/link diff --git a/tests/test_expr_path_flag.out b/tests/test_expr_path_flag.out index c37a541..3112cd2 100644 --- a/tests/test_expr_path_flag.out +++ b/tests/test_expr_path_flag.out @@ -1 +1 @@ -links/skip/loop +links/skip/link diff --git a/tests/test_flag_expr_path.out b/tests/test_flag_expr_path.out index c37a541..3112cd2 100644 --- a/tests/test_flag_expr_path.out +++ b/tests/test_flag_expr_path.out @@ -1 +1 @@ -links/skip/loop +links/skip/link diff --git a/tests/test_follow.out b/tests/test_follow.out index dc88380..cf21a44 100644 --- a/tests/test_follow.out +++ b/tests/test_follow.out @@ -8,5 +8,8 @@ links/skip links/symlink links/deeply/nested links/skip/dir -links/skip/loop +links/skip/file +links/skip/link links/deeply/nested/dir +links/deeply/nested/file +links/deeply/nested/link diff --git a/tests/test_links_minus.out b/tests/test_links_minus.out index e69de29..eda26f1 100644 --- a/tests/test_links_minus.out +++ b/tests/test_links_minus.out @@ -0,0 +1 @@ +links/deeply/nested/file diff --git a/tests/test_path_expr_flag.out b/tests/test_path_expr_flag.out index c37a541..3112cd2 100644 --- a/tests/test_path_expr_flag.out +++ b/tests/test_path_expr_flag.out @@ -1 +1 @@ -links/skip/loop +links/skip/link diff --git a/tests/test_path_flag_expr.out b/tests/test_path_flag_expr.out index c37a541..3112cd2 100644 --- a/tests/test_path_flag_expr.out +++ b/tests/test_path_flag_expr.out @@ -1 +1 @@ -links/skip/loop +links/skip/link diff --git a/tests/test_printf_types.out b/tests/test_printf_types.out index b548b10..9cfe347 100644 --- a/tests/test_printf_types.out +++ b/tests/test_printf_types.out @@ -1,12 +1,11 @@ -(links) () d 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 +(loops) () d d +(loops/broken) (nowhere) l N +(loops/deeply) () d d +(loops/file) () f f +(loops/loop) (loop) l L +(loops/symlink) (file) l f +(loops/deeply/nested) () d d +(loops/notdir) (symlink/file) l N +(loops/deeply/nested/dir) () d d +(loops/skip) (deeply/nested/loop/nested) l d +(loops/deeply/nested/loop) (../../deeply) l d diff --git a/tests/test_type_multi.out b/tests/test_type_multi.out index 316ab7f..d22ed9f 100644 --- a/tests/test_type_multi.out +++ b/tests/test_type_multi.out @@ -4,3 +4,4 @@ links/file links/hardlink links/deeply/nested links/deeply/nested/dir +links/deeply/nested/file diff --git a/tests/test_xtype_f.out b/tests/test_xtype_f.out index 222ac78..dbe0c3f 100644 --- a/tests/test_xtype_f.out +++ b/tests/test_xtype_f.out @@ -1,3 +1,5 @@ links/file links/hardlink links/symlink +links/deeply/nested/file +links/deeply/nested/link diff --git a/tests/test_xtype_multi.out b/tests/test_xtype_multi.out index f9847db..171c580 100644 --- a/tests/test_xtype_multi.out +++ b/tests/test_xtype_multi.out @@ -6,4 +6,5 @@ links/skip links/symlink links/deeply/nested links/deeply/nested/dir -links/deeply/nested/loop +links/deeply/nested/file +links/deeply/nested/link |