Lines Matching full:some
24 /// assert_eq!(diff_paths("/foo/bar", "/foo/bar/baz"), Some("../".into()));
25 /// assert_eq!(diff_paths("/foo/bar/baz", "/foo/bar"), Some("baz".into()));
26 /// assert_eq!(diff_paths("/foo/bar/quux", "/foo/bar/baz"), Some("../quux".into()));
27 /// assert_eq!(diff_paths("/foo/bar/baz", "/foo/bar/quux"), Some("../baz".into()));
28 /// assert_eq!(diff_paths("/foo/bar", "/foo/bar/quux"), Some("../".into()));
30 /// assert_eq!(diff_paths("/foo/bar", "baz"), Some("/foo/bar".into()));
31 /// assert_eq!(diff_paths("/foo/bar", "/baz"), Some("../foo/bar".into()));
32 /// assert_eq!(diff_paths("foo", "bar"), Some("../foo".into()));
36 /// Some("baz".into())
40 /// Some("baz".into())
53 Some(PathBuf::from(path)) in diff_paths()
64 (Some(a), None) => { in diff_paths()
70 (Some(a), Some(b)) if comps.is_empty() && a == b => (), in diff_paths()
71 (Some(a), Some(b)) if b == Component::CurDir => comps.push(a), in diff_paths()
72 (Some(_), Some(b)) if b == Component::ParentDir => return None, in diff_paths()
73 (Some(a), Some(_)) => { in diff_paths()
84 Some(comps.iter().map(|c| c.as_os_str()).collect()) in diff_paths()
101 /// assert_eq!(diff_utf8_paths("/foo/bar", "/foo/bar/baz"), Some("../".into()));
102 /// assert_eq!(diff_utf8_paths("/foo/bar/baz", "/foo/bar"), Some("baz".into()));
103 /// assert_eq!(diff_utf8_paths("/foo/bar/quux", "/foo/bar/baz"), Some("../quux".into()));
104 /// assert_eq!(diff_utf8_paths("/foo/bar/baz", "/foo/bar/quux"), Some("../baz".into()));
105 /// assert_eq!(diff_utf8_paths("/foo/bar", "/foo/bar/quux"), Some("../".into()));
107 /// assert_eq!(diff_utf8_paths("/foo/bar", "baz"), Some("/foo/bar".into()));
108 /// assert_eq!(diff_utf8_paths("/foo/bar", "/baz"), Some("../foo/bar".into()));
109 /// assert_eq!(diff_utf8_paths("foo", "bar"), Some("../foo".into()));
113 /// Some("baz".into())
117 /// Some("baz".into())
131 Some(Utf8PathBuf::from(path)) in diff_utf8_paths()
142 (Some(a), None) => { in diff_utf8_paths()
148 (Some(a), Some(b)) if comps.is_empty() && a == b => (), in diff_utf8_paths()
149 (Some(a), Some(b)) if b == Utf8Component::CurDir => comps.push(a), in diff_utf8_paths()
150 (Some(_), Some(b)) if b == Utf8Component::ParentDir => return None, in diff_utf8_paths()
151 (Some(a), Some(_)) => { in diff_utf8_paths()
162 Some(comps.iter().map(|c| c.as_str()).collect()) in diff_utf8_paths()
188 assert_diff_paths(&abs("foo"), &abs("bar"), Some("../foo")); in test_absolute()
189 assert_diff_paths(&abs("foo"), "bar", Some(&abs("foo"))); in test_absolute()
191 assert_diff_paths("foo", "bar", Some("../foo")); in test_absolute()
196 assert_diff_paths(".", ".", Some("")); in test_identity()
197 assert_diff_paths("../foo", "../foo", Some("")); in test_identity()
198 assert_diff_paths("./foo", "./foo", Some("")); in test_identity()
199 assert_diff_paths("/foo", "/foo", Some("")); in test_identity()
200 assert_diff_paths("foo", "foo", Some("")); in test_identity()
202 assert_diff_paths("../foo/bar/baz", "../foo/bar/baz", Some("".into())); in test_identity()
203 assert_diff_paths("foo/bar/baz", "foo/bar/baz", Some("")); in test_identity()
208 assert_diff_paths("foo", "fo", Some("../foo")); in test_subset()
209 assert_diff_paths("fo", "foo", Some("../fo")); in test_subset()
214 assert_diff_paths("", "", Some("")); in test_empty()
215 assert_diff_paths("foo", "", Some("foo")); in test_empty()
216 assert_diff_paths("", "foo", Some("..")); in test_empty()
221 assert_diff_paths("../foo", "../bar", Some("../foo")); in test_relative()
222 assert_diff_paths("../foo", "../foo/bar/baz", Some("../..")); in test_relative()
223 assert_diff_paths("../foo/bar/baz", "../foo", Some("bar/baz")); in test_relative()
225 assert_diff_paths("foo/bar/baz", "foo", Some("bar/baz")); in test_relative()
226 assert_diff_paths("foo/bar/baz", "foo/bar", Some("baz")); in test_relative()
227 assert_diff_paths("foo/bar/baz", "foo/bar/baz", Some("")); in test_relative()
228 assert_diff_paths("foo/bar/baz", "foo/bar/baz/", Some("")); in test_relative()
230 assert_diff_paths("foo/bar/baz/", "foo", Some("bar/baz")); in test_relative()
231 assert_diff_paths("foo/bar/baz/", "foo/bar", Some("baz")); in test_relative()
232 assert_diff_paths("foo/bar/baz/", "foo/bar/baz", Some("")); in test_relative()
233 assert_diff_paths("foo/bar/baz/", "foo/bar/baz/", Some("")); in test_relative()
235 assert_diff_paths("foo/bar/baz", "foo/", Some("bar/baz")); in test_relative()
236 assert_diff_paths("foo/bar/baz", "foo/bar/", Some("baz")); in test_relative()
237 assert_diff_paths("foo/bar/baz", "foo/bar/baz", Some("")); in test_relative()
242 assert_diff_paths(".", "foo", Some("../.")); in test_current_directory()
243 assert_diff_paths("foo", ".", Some("foo")); in test_current_directory()
244 assert_diff_paths("/foo", "/.", Some("foo")); in test_current_directory()