libpath-ruby 0.2.2 → 0.2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +33 -0
- data/README.md +25 -8
- data/examples/path_from_arg0.md +43 -43
- data/examples/path_from_arg0.rb +25 -23
- data/lib/libpath/constants/unix.rb +74 -74
- data/lib/libpath/constants/windows.rb +75 -75
- data/lib/libpath/constants.rb +20 -20
- data/lib/libpath/diagnostics/parameter_checking.rb +27 -26
- data/lib/libpath/diagnostics.rb +1 -1
- data/lib/libpath/exceptions/libpath_base_exception.rb +20 -21
- data/lib/libpath/exceptions/malformed_name_exception.rb +27 -27
- data/lib/libpath/exceptions.rb +1 -1
- data/lib/libpath/form/unix.rb +118 -118
- data/lib/libpath/form/windows.rb +228 -214
- data/lib/libpath/form.rb +20 -21
- data/lib/libpath/internal_/array.rb +57 -57
- data/lib/libpath/internal_/platform.rb +30 -31
- data/lib/libpath/internal_/string.rb +25 -20
- data/lib/libpath/internal_/unix/form.rb +124 -119
- data/lib/libpath/internal_/windows/drive.rb +80 -75
- data/lib/libpath/internal_/windows/form.rb +205 -194
- data/lib/libpath/libpath.rb +4 -1
- data/lib/libpath/path/unix.rb +120 -118
- data/lib/libpath/path/windows.rb +126 -124
- data/lib/libpath/path.rb +21 -21
- data/lib/libpath/util/unix.rb +261 -261
- data/lib/libpath/util/windows.rb +403 -403
- data/lib/libpath/util.rb +20 -20
- data/lib/libpath/version.rb +25 -26
- data/lib/libpath.rb +1 -1
- data/test/performance/benchmark_drive_letter.rb +50 -10
- data/test/performance/benchmark_gsub_string_or_regex.rb +27 -23
- data/test/performance/benchmark_rindex2.rb +56 -48
- data/test/performance/benchmark_split.rb +16 -10
- data/test/unit/compare/ts_all.rb +4 -4
- data/test/unit/equate/ts_all.rb +4 -4
- data/test/unit/equate/unix/ts_all.rb +4 -4
- data/test/unit/equate/windows/ts_all.rb +4 -4
- data/test/unit/exceptions/tc_libpath_base_exception.rb +10 -8
- data/test/unit/exceptions/tc_malformed_name_exception.rb +14 -12
- data/test/unit/exceptions/ts_all.rb +4 -4
- data/test/unit/form/tc_absolute_functions.rb +242 -240
- data/test/unit/form/ts_all.rb +4 -4
- data/test/unit/form/unix/tc_absolute_functions.rb +158 -155
- data/test/unit/form/unix/ts_all.rb +4 -4
- data/test/unit/form/windows/tc_absolute_functions.rb +628 -625
- data/test/unit/form/windows/ts_all.rb +4 -4
- data/test/unit/internal_/tc_array.rb +36 -32
- data/test/unit/internal_/ts_all.rb +4 -4
- data/test/unit/internal_/unix/form/tc_slash_functions.rb +38 -35
- data/test/unit/internal_/unix/form/ts_all.rb +4 -4
- data/test/unit/internal_/unix/tc_split_path.rb +387 -384
- data/test/unit/internal_/unix/ts_all.rb +4 -4
- data/test/unit/internal_/windows/form/tc_get_windows_volume.rb +157 -153
- data/test/unit/internal_/windows/form/tc_slash_functions.rb +39 -35
- data/test/unit/internal_/windows/form/ts_all.rb +4 -4
- data/test/unit/internal_/windows/tc_split_path.rb +874 -869
- data/test/unit/internal_/windows/ts_all.rb +4 -4
- data/test/unit/parse/ts_all.rb +4 -4
- data/test/unit/path/tc_path.rb +732 -732
- data/test/unit/path/ts_all.rb +4 -4
- data/test/unit/path/unix/tc_path.rb +544 -540
- data/test/unit/path/unix/ts_all.rb +4 -4
- data/test/unit/path/windows/tc_path.rb +608 -603
- data/test/unit/path/windows/ts_all.rb +4 -4
- data/test/unit/tc_version.rb +25 -22
- data/test/unit/ts_all.rb +4 -4
- data/test/unit/util/tc_combine_paths.rb +110 -105
- data/test/unit/util/tc_derive_relative_path.rb +8 -3
- data/test/unit/util/tc_make_path_canonical.rb +142 -138
- data/test/unit/util/ts_all.rb +4 -4
- data/test/unit/util/unix/tc_combine_paths.rb +38 -34
- data/test/unit/util/unix/tc_derive_relative_path.rb +80 -75
- data/test/unit/util/unix/tc_make_path_absolute.rb +74 -70
- data/test/unit/util/unix/tc_make_path_canonical.rb +95 -90
- data/test/unit/util/unix/ts_all.rb +4 -4
- data/test/unit/util/windows/tc_combine_paths.rb +82 -77
- data/test/unit/util/windows/tc_derive_relative_path.rb +98 -93
- data/test/unit/util/windows/tc_make_path_absolute.rb +105 -101
- data/test/unit/util/windows/tc_make_path_canonical.rb +158 -153
- data/test/unit/util/windows/ts_all.rb +4 -4
- metadata +9 -8
@@ -2,138 +2,143 @@
|
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), *(['..'] * 4), 'lib')
|
4
4
|
|
5
|
+
|
5
6
|
require 'libpath/util/unix'
|
6
7
|
|
7
8
|
require 'test/unit'
|
8
9
|
|
10
|
+
|
9
11
|
class Test_LibPath_Util_Unix_make_path_canonical < Test::Unit::TestCase
|
10
12
|
|
11
|
-
|
13
|
+
F = ::LibPath::Util::Unix
|
12
14
|
|
13
|
-
|
15
|
+
def test_empty
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
+
assert_equal '', F.make_path_canonical('')
|
18
|
+
end
|
17
19
|
|
18
|
-
|
20
|
+
def test_one_dot
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
assert_equal './', F.make_path_canonical('.')
|
23
|
+
assert_equal './', F.make_path_canonical('./')
|
24
|
+
assert_equal './', F.make_path_canonical('./.')
|
25
|
+
assert_equal './', F.make_path_canonical('./.')
|
26
|
+
assert_equal './', F.make_path_canonical('././')
|
27
|
+
assert_equal './', F.make_path_canonical('.//./')
|
28
|
+
assert_equal './', F.make_path_canonical('.////./')
|
29
|
+
assert_equal './', F.make_path_canonical('././.')
|
30
|
+
assert_equal './', F.make_path_canonical('./././')
|
31
|
+
end
|
30
32
|
|
31
|
-
|
33
|
+
def test_two_dots
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
assert_equal '../', F.make_path_canonical('..')
|
36
|
+
assert_equal '../', F.make_path_canonical('../')
|
37
|
+
assert_equal '../', F.make_path_canonical('../.')
|
38
|
+
assert_equal '../', F.make_path_canonical('.././')
|
39
|
+
assert_equal '../', F.make_path_canonical('..//./')
|
40
|
+
assert_equal '../', F.make_path_canonical('..////./')
|
41
|
+
assert_equal '../', F.make_path_canonical('.././.')
|
42
|
+
end
|
41
43
|
|
42
|
-
|
44
|
+
def test_unresolveable
|
43
45
|
|
44
|
-
|
45
|
-
|
46
|
+
assert_equal '../', F.make_path_canonical('..')
|
47
|
+
assert_equal '../', F.make_path_canonical('../')
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
+
assert_equal '../dir-1', F.make_path_canonical('../dir-1')
|
50
|
+
assert_equal '../dir-1/', F.make_path_canonical('../dir-1/')
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
+
assert_equal '../../', F.make_path_canonical('../..')
|
53
|
+
assert_equal '../../', F.make_path_canonical('../../')
|
52
54
|
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
assert_equal '../../dir-1', F.make_path_canonical('../../dir-1')
|
56
|
+
assert_equal '../../dir-1/', F.make_path_canonical('../../dir-1/')
|
57
|
+
end
|
56
58
|
|
57
|
-
|
59
|
+
def test_partially_resolveable
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
+
assert_equal '../', F.make_path_canonical('../dir-1/..')
|
62
|
+
assert_equal '../', F.make_path_canonical('../dir-1/../')
|
61
63
|
|
62
|
-
|
63
|
-
|
64
|
+
assert_equal '../abc', F.make_path_canonical('../dir-1/../abc')
|
65
|
+
assert_equal '../abc/', F.make_path_canonical('../dir-1/../abc/')
|
64
66
|
|
65
|
-
|
66
|
-
|
67
|
+
assert_equal '../../', F.make_path_canonical('../../dir-1/..')
|
68
|
+
assert_equal '../../', F.make_path_canonical('../../dir-1/../')
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
+
assert_equal '../../abc', F.make_path_canonical('../../dir-1/../abc')
|
71
|
+
assert_equal '../../abc/', F.make_path_canonical('../../dir-1/../abc/')
|
70
72
|
|
71
|
-
|
72
|
-
|
73
|
+
assert_equal '/dir.14/', F.make_path_canonical('/dir.14/dir.2/..')
|
74
|
+
assert_equal 'dir.14/', F.make_path_canonical('dir.14/dir.2/..')
|
73
75
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
76
|
+
assert_equal '/', F.make_path_canonical('/dir.14/dir.2/../..')
|
77
|
+
assert_equal '/', F.make_path_canonical('/dir.14/dir.2/../../..')
|
78
|
+
assert_equal './', F.make_path_canonical('dir.14/dir.2/../..')
|
79
|
+
end
|
78
80
|
|
79
|
-
|
81
|
+
def test_basenames
|
80
82
|
|
81
|
-
|
83
|
+
assert_equal 'a', F.make_path_canonical('a')
|
82
84
|
|
83
|
-
|
85
|
+
assert_equal 'file.ext', F.make_path_canonical('file.ext')
|
84
86
|
|
85
|
-
|
86
|
-
|
87
|
+
assert_equal '../', F.make_path_canonical('..')
|
88
|
+
end
|
87
89
|
|
88
|
-
|
90
|
+
def test_no_dots
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
92
|
+
assert_equal 'abc/def', F.make_path_canonical('abc/def')
|
93
|
+
assert_equal 'abc/def', F.make_path_canonical('abc//def')
|
94
|
+
assert_equal 'abc/def', F.make_path_canonical('abc///def')
|
95
|
+
end
|
94
96
|
|
95
|
-
|
97
|
+
def test_one_dots_directories
|
96
98
|
|
97
|
-
|
98
|
-
|
99
|
+
assert_equal 'abc', F.make_path_canonical('./abc')
|
100
|
+
assert_equal 'abc/', F.make_path_canonical('./abc/')
|
99
101
|
|
100
|
-
|
101
|
-
|
102
|
+
assert_equal 'abc', F.make_path_canonical('././abc')
|
103
|
+
assert_equal 'abc/', F.make_path_canonical('././abc/')
|
102
104
|
|
103
|
-
|
104
|
-
|
105
|
+
assert_equal 'abc', F.make_path_canonical('./././././././././abc')
|
106
|
+
assert_equal 'abc/', F.make_path_canonical('./././././././././abc/')
|
105
107
|
|
106
|
-
|
107
|
-
|
108
|
+
assert_equal 'abc/', F.make_path_canonical('abc/.')
|
109
|
+
assert_equal 'abc/', F.make_path_canonical('abc/./')
|
108
110
|
|
109
|
-
|
110
|
-
|
111
|
-
|
111
|
+
assert_equal 'abc/', F.make_path_canonical('./abc/.')
|
112
|
+
assert_equal 'abc/', F.make_path_canonical('./abc/./')
|
113
|
+
end
|
112
114
|
|
113
|
-
|
115
|
+
def test_two_dots_directories
|
114
116
|
|
115
|
-
|
116
|
-
|
117
|
+
assert_equal '../', F.make_path_canonical('..')
|
118
|
+
assert_equal '../', F.make_path_canonical('../')
|
117
119
|
|
118
|
-
|
119
|
-
|
120
|
+
assert_equal '../abc', F.make_path_canonical('../abc')
|
121
|
+
assert_equal '../abc/', F.make_path_canonical('../abc/')
|
120
122
|
|
121
|
-
|
122
|
-
|
123
|
+
assert_equal './', F.make_path_canonical('abc/..')
|
124
|
+
assert_equal './', F.make_path_canonical('abc/../')
|
123
125
|
|
124
|
-
|
125
|
-
|
126
|
+
assert_equal 'def', F.make_path_canonical('abc/../def')
|
127
|
+
assert_equal 'def/', F.make_path_canonical('abc/../def/')
|
126
128
|
|
127
|
-
|
128
|
-
|
129
|
+
assert_equal './', F.make_path_canonical('abc/../def/..')
|
130
|
+
assert_equal './', F.make_path_canonical('abc/../def/../')
|
129
131
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
132
|
+
assert_equal '../dir-2/', F.make_path_canonical('../dir-1/../dir-2/')
|
133
|
+
assert_equal '../dir-2', F.make_path_canonical('../dir-1/../dir-2')
|
134
|
+
assert_equal '/dir-2', F.make_path_canonical('/../dir-1/../dir-2')
|
135
|
+
assert_equal '/', F.make_path_canonical('/../')
|
136
|
+
assert_equal '/', F.make_path_canonical('/..')
|
137
|
+
assert_equal('/', F.make_path_canonical('/dir.14/dir.2/../..'))
|
138
|
+
assert_equal('/', F.make_path_canonical('/dir.14/dir.2/../../..'))
|
139
|
+
end
|
138
140
|
end
|
139
141
|
|
142
|
+
|
143
|
+
# ############################## end of file ############################# #
|
144
|
+
|
@@ -7,16 +7,16 @@ this_dir = File.expand_path(File.dirname(__FILE__))
|
|
7
7
|
# all tc_*rb in current directory
|
8
8
|
Dir[File.join(this_dir, 'tc_*rb')].each do |file|
|
9
9
|
|
10
|
-
|
10
|
+
$stderr.puts "requiring file '#{file}'" if $DEBUG
|
11
11
|
|
12
|
-
|
12
|
+
require file
|
13
13
|
end
|
14
14
|
|
15
15
|
# all ts_*rb in immediate sub-directories
|
16
16
|
Dir[File.join(this_dir, '*', 'ts_*rb')].each do |file|
|
17
17
|
|
18
|
-
|
18
|
+
$stderr.puts "requiring file '#{file}'" if $DEBUG
|
19
19
|
|
20
|
-
|
20
|
+
require file
|
21
21
|
end
|
22
22
|
|
@@ -2,130 +2,135 @@
|
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), *(['..'] * 4), 'lib')
|
4
4
|
|
5
|
+
|
5
6
|
require 'libpath/util/windows'
|
6
7
|
|
7
8
|
require 'test/unit'
|
8
9
|
|
10
|
+
|
9
11
|
class Test_LibPath_Util_Windows_combine_paths < Test::Unit::TestCase
|
10
12
|
|
11
|
-
|
13
|
+
F = ::LibPath::Util::Windows
|
12
14
|
|
13
|
-
|
15
|
+
def test_no_arguments
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
+
assert_equal '', F.combine_paths()
|
18
|
+
end
|
17
19
|
|
18
|
-
|
20
|
+
def test_single_argument
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
assert_equal ' ', F.combine_paths(' ')
|
23
|
+
assert_equal 'a', F.combine_paths('a')
|
24
|
+
assert_equal 'abcdef/ghi/jkl.mno', F.combine_paths('abcdef/ghi/jkl.mno')
|
25
|
+
assert_equal '/', F.combine_paths('/')
|
26
|
+
end
|
25
27
|
|
26
|
-
|
28
|
+
def test_relative_cases
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
+
assert_equal 'a\\b\\c/d', F.combine_paths('a', 'b', 'c/d')
|
31
|
+
end
|
30
32
|
|
31
|
-
|
33
|
+
def test_tail_absolute_cases
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
assert_equal 'X:/', F.combine_paths('a', 'X:/')
|
36
|
+
assert_equal 'X:\\', F.combine_paths('a', 'X:\\')
|
37
|
+
assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\\\?\\X:\\')
|
38
|
+
end
|
37
39
|
|
38
|
-
|
40
|
+
def test_tail_absolute_cases_2
|
39
41
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
assert_equal 'Y:/', F.combine_paths('a', 'X:/', 'Y:/')
|
43
|
+
assert_equal 'Y:\\', F.combine_paths('a', 'X:/', 'Y:\\')
|
44
|
+
assert_equal 'Y:\\', F.combine_paths('a', '\\\\?\\X:/', 'Y:\\')
|
45
|
+
assert_equal '\\\\?\\Y:\\', F.combine_paths('a', 'X:/', '\\\\?\\Y:\\')
|
46
|
+
end
|
45
47
|
|
46
|
-
|
48
|
+
def test_tail_absolute_cases_3
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
|
50
|
+
assert_equal 'X:\\', F.combine_paths('a', 'X:', '\\')
|
51
|
+
assert_equal 'X:\\', F.combine_paths('a', '\\', 'X:')
|
52
|
+
assert_equal 'X:\\', F.combine_paths('X:', 'a', '\\')
|
51
53
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\\\?\\X:', '\\')
|
55
|
+
assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\', '\\\\?\\X:')
|
56
|
+
assert_equal '\\\\?\\X:\\', F.combine_paths('\\\\?\\X:', 'a', '\\')
|
57
|
+
end
|
56
58
|
|
57
|
-
|
59
|
+
def test_tail_absolute_cases_4
|
58
60
|
|
59
|
-
|
61
|
+
assert_equal 'Z:\\', F.combine_paths('a', 'X:/', '\\', 'Z:')
|
60
62
|
|
61
|
-
|
63
|
+
assert_equal '\\\\?\\Z:\\', F.combine_paths('a', '\\\\?\\X:/', '\\', '\\\\?\\Z:')
|
62
64
|
|
63
|
-
|
65
|
+
assert_equal '\\\\?\\UNC\\server\\share/abc', F.combine_paths('a', '\\\\?\\X:/', '/abc', '\\\\?\\UNC\\server\\share')
|
64
66
|
|
65
|
-
|
66
|
-
|
67
|
-
|
67
|
+
assert_equal '\\\\.\\{1234-abcd}/abc', F.combine_paths('a', '\\\\?\\X:/', '/abc', '\\\\.\\{1234-abcd}')
|
68
|
+
assert_equal '\\\\.\\{1234-abcd}/abc', F.combine_paths('a', '\\\\?\\X:/', '\\\\.\\{1234-abcd}', '/abc')
|
69
|
+
end
|
68
70
|
|
69
|
-
|
71
|
+
def test_tail_absolute_cases_5
|
70
72
|
|
71
|
-
|
73
|
+
assert_equal 'Z:\\dir\\a\\b', F.combine_paths('a', 'X:/y', '\\dir', 'Z:', 'a', 'b')
|
72
74
|
|
73
|
-
|
75
|
+
assert_equal 'Z:\\dir\\a\\b', F.combine_paths('a', '\\\\?\\X:/y', '\\dir', 'Z:', 'a', 'b')
|
74
76
|
|
75
|
-
|
76
|
-
|
77
|
+
assert_equal '\\\\?\\Z:\\dir\\a\\b', F.combine_paths('a', 'X:/y', '\\dir', '\\\\?\\Z:', 'a', 'b')
|
78
|
+
end
|
77
79
|
|
78
|
-
|
80
|
+
def test_tail_absolute_cases_6
|
79
81
|
|
80
|
-
|
81
|
-
|
82
|
+
assert_equal 'Z:\\b', F.combine_paths('a', 'X:/', 'Z:', 'a', '\\', 'b')
|
83
|
+
end
|
82
84
|
|
83
|
-
|
85
|
+
def test_tail_absolute_cases_7
|
84
86
|
|
85
|
-
|
86
|
-
|
87
|
+
assert_equal 'Z:\\a\\c\\b', F.combine_paths('a', 'X:/', '\\a', 'c', 'Z:', 'b')
|
88
|
+
end
|
87
89
|
|
88
|
-
|
90
|
+
def test_tail_absolute_cases_8
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
+
assert_equal 'X:/y\\b', F.combine_paths('a', '\\a', 'c', 'Z:', 'X:/y', 'b')
|
93
|
+
end
|
92
94
|
|
93
|
-
|
95
|
+
def test_tail_absolute_cases_9
|
94
96
|
|
95
|
-
|
96
|
-
|
97
|
-
|
97
|
+
assert_equal 'Z:\\y\\b', F.combine_paths('a', '\\a', 'c', 'X:\\y', 'Z:', 'b')
|
98
|
+
assert_equal 'Z:/y\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', 'Z:', 'b')
|
99
|
+
end
|
98
100
|
|
99
|
-
|
101
|
+
def test_tail_absolute_cases_10
|
100
102
|
|
101
|
-
|
102
|
-
|
103
|
+
assert_equal 'X:\\dir-1\\dir-2\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', '\\dir-1\\dir-2', 'b')
|
104
|
+
assert_equal 'X:\\dir-1/dir-2\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', '\\dir-1/dir-2', 'b')
|
103
105
|
|
104
|
-
|
106
|
+
assert_equal '/', F.combine_paths('a', '/')
|
105
107
|
|
106
|
-
|
108
|
+
assert_equal '/', F.combine_paths('a/b/c/d', '/')
|
107
109
|
|
108
|
-
|
109
|
-
|
110
|
+
assert_equal '/', F.combine_paths('a', 'b', '/')
|
111
|
+
end
|
110
112
|
|
111
|
-
|
113
|
+
def test_drive_only
|
112
114
|
|
113
|
-
|
114
|
-
|
115
|
+
assert_equal 'D:', F.combine_paths('D:')
|
116
|
+
assert_equal 'D:dir-1\\dir-2', F.combine_paths('D:', 'dir-1\\dir-2')
|
115
117
|
|
116
|
-
|
117
|
-
|
118
|
-
|
118
|
+
assert_equal '\\\\?\\D:', F.combine_paths('\\\\?\\D:')
|
119
|
+
assert_equal '\\\\?\\D:dir-1\\dir-2', F.combine_paths('\\\\?\\D:', 'dir-1\\dir-2')
|
120
|
+
end
|
119
121
|
|
120
|
-
|
122
|
+
def test_embedded_absolute_cases
|
121
123
|
|
122
|
-
|
123
|
-
|
124
|
-
|
124
|
+
assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', 'z', '/a', 'b', 'c/d')
|
125
|
+
assert_equal '\\a\\b\\c/d', F.combine_paths('x/y/z', 'z', '\\a', 'b', 'c/d')
|
126
|
+
end
|
125
127
|
|
126
|
-
|
128
|
+
def test_multiple_embedded_absolute_cases
|
127
129
|
|
128
|
-
|
129
|
-
|
130
|
+
assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
|
131
|
+
end
|
130
132
|
end
|
131
133
|
|
134
|
+
|
135
|
+
# ############################## end of file ############################# #
|
136
|
+
|