1 parent 64a8061 commit 63077e8Copy full SHA for 63077e8
1 file changed
test/unix_path.rb
@@ -161,6 +161,18 @@ def assert_filenames(cases)
161
expect(muimmu.to_s).must_equal '/etc/systemd/var/lib'
162
end
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
176
describe 'empty filename' do
177
it "indicates a directory when empty" do
178
path = UnixPath.parse("/home/user/docs/")
0 commit comments