From e5ba75f3c8f30bfe7a957a75be8334dad67ae941 Mon Sep 17 00:00:00 2001 From: Simon Engmann Date: Thu, 14 Nov 2019 22:27:53 +0100 Subject: [PATCH] Add tests for `--same-file-system` --- tests/tests.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/tests.rs b/tests/tests.rs index 7237252..8a635ae 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -555,6 +555,23 @@ fn test_follow() { ); } +// File system boundaries (--same-file-system) +// Limited to Unix because, to the best of my knowledge, there is no easy way to test a use case +// file systems mounted into the tree on Windows. +#[test] +#[cfg(unix)] +fn test_file_system_boundaries() { + // Can't simulate file system boundaries + let te = TestEnv::new(&[], &[]); + + // /dev/null should exist in all sane Unixes + te.assert_output(&["--full-path", "^/dev/null$", "/"], "/dev/null"); + te.assert_output( + &["--same-file-system", "--full-path", "^/dev/null$", "/"], + "", + ); +} + /// Null separator (--print0) #[test] fn test_print0() {