File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,18 @@ def assert_filenames(cases)
161
161
expect ( muimmu . to_s ) . must_equal '/etc/systemd/var/lib'
162
162
end
163
163
164
+ it "handles complex slash chains with strings" do
165
+ # start with an abspath dir
166
+ path1 = UnixPath . parse ( '/home/user/' )
167
+ result1 = path1 / 'docs/project' / 'file.txt'
168
+ expect ( result1 . to_s ) . must_equal '/home/user/docs/project/file.txt'
169
+
170
+ # start with a relpath file
171
+ path2 = UnixPath . parse ( './relative/path' )
172
+ result2 = path2 / 'more/dirs/' / '/etc/passwd'
173
+ expect ( result2 . to_s ) . must_equal './relative/path/more/dirs/etc/passwd'
174
+ end
175
+
164
176
describe 'empty filename' do
165
177
it "indicates a directory when empty" do
166
178
path = UnixPath . parse ( "/home/user/docs/" )
You can’t perform that action at this time.
0 commit comments