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