diff options
author | Ian Kerins <ianskerins@gmail.com> | 2016-10-08 22:40:03 -0400 |
---|---|---|
committer | Ian Kerins <ianskerins@gmail.com> | 2016-10-08 22:40:03 -0400 |
commit | 1c964372ad7cfb70116101480638e39a0d07d762 (patch) | |
tree | 5717b2171cfce02d361e533e79bf1690b588c4de /tests | |
parent | 4ee6dbe422f05025a26388a8a863ba4b99e43bb7 (diff) |
Always follow symlinks on explicit file arguments.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index d27db8ce..1308d715 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -567,6 +567,25 @@ baz/sherlock:be, to a very large extent, the result of luck. Sherlock Holmes assert_eq!(lines, path(expected)); }); +// Follow symlinks on explicit file arguments. +sherlock!(symlink_explicit_file, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { + wd.link("sherlock", "sym1"); + wd.link("sherlock", "sym2"); + cmd.arg("sym1"); + cmd.arg("sym2"); + + let lines: String = wd.stdout(&mut cmd); + let expected = "\ +sherlock:For the Doctor Watsons of this world, as opposed to the Sherlock +sherlock:be, to a very large extent, the result of luck. Sherlock Holmes +sym1:For the Doctor Watsons of this world, as opposed to the Sherlock +sym1:be, to a very large extent, the result of luck. Sherlock Holmes +sym2:For the Doctor Watsons of this world, as opposed to the Sherlock +sym2:be, to a very large extent, the result of luck. Sherlock Holmes +"; + assert_eq!(lines, path(expected)); +}); + sherlock!(unrestricted1, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { wd.create(".gitignore", "sherlock\n"); cmd.arg("-u"); |