From 918dfc6ef0d772ef1d9987d70774e1b358b53c88 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Fri, 28 Feb 2020 13:33:15 +0100 Subject: [PATCH] Add expected behavior as unit tests --- tests/tests.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/tests.rs b/tests/tests.rs index 87f3256..ad8a1e1 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -604,7 +604,24 @@ fn test_follow_broken_symlink() { te.create_broken_symlink("broken_symlink") .expect("Failed to create broken symlink."); - te.assert_output(&["--follow", "--type", "f", "symlink"], "broken_symlink"); + te.assert_output( + &["symlink"], + "broken_symlink + symlink", + ); + te.assert_output( + &["--type", "symlink", "symlink"], + "broken_symlink + symlink", + ); + + te.assert_output(&["--type", "file", "symlink"], ""); + + te.assert_output( + &["--follow", "--type", "symlink", "symlink"], + "broken_symlink", + ); + te.assert_output(&["--follow", "--type", "file", "symlink"], ""); } /// Null separator (--print0)