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
@@ -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
 
@@ -8,40 +8,43 @@ require 'test/unit'
8
8
 
9
9
  class Test_version < Test::Unit::TestCase
10
10
 
11
- def test_has_VERSION
11
+ def test_has_VERSION
12
12
 
13
- assert defined? LibPath::VERSION
14
- end
13
+ assert defined? LibPath::VERSION
14
+ end
15
15
 
16
- def test_has_VERSION_MAJOR
16
+ def test_has_VERSION_MAJOR
17
17
 
18
- assert defined? LibPath::VERSION_MAJOR
19
- end
18
+ assert defined? LibPath::VERSION_MAJOR
19
+ end
20
20
 
21
- def test_has_VERSION_MINOR
21
+ def test_has_VERSION_MINOR
22
22
 
23
- assert defined? LibPath::VERSION_MINOR
24
- end
23
+ assert defined? LibPath::VERSION_MINOR
24
+ end
25
25
 
26
- def test_has_VERSION_REVISION
26
+ def test_has_VERSION_REVISION
27
27
 
28
- assert defined? LibPath::VERSION_REVISION
29
- end
28
+ assert defined? LibPath::VERSION_REVISION
29
+ end
30
30
 
31
- def test_VERSION_has_consistent_format
31
+ def test_VERSION_has_consistent_format
32
32
 
33
- if LibPath::VERSION_SUBPATCH
33
+ if LibPath::VERSION_SUBPATCH
34
34
 
35
- assert_equal LibPath::VERSION, "#{LibPath::VERSION_MAJOR}.#{LibPath::VERSION_MINOR}.#{LibPath::VERSION_PATCH}.#{LibPath::VERSION_SUBPATCH}"
36
- else
35
+ assert_equal LibPath::VERSION, "#{LibPath::VERSION_MAJOR}.#{LibPath::VERSION_MINOR}.#{LibPath::VERSION_PATCH}.#{LibPath::VERSION_SUBPATCH}"
36
+ else
37
37
 
38
- assert_equal LibPath::VERSION, "#{LibPath::VERSION_MAJOR}.#{LibPath::VERSION_MINOR}.#{LibPath::VERSION_PATCH}"
39
- end
40
- end
38
+ assert_equal LibPath::VERSION, "#{LibPath::VERSION_MAJOR}.#{LibPath::VERSION_MINOR}.#{LibPath::VERSION_PATCH}"
39
+ end
40
+ end
41
41
 
42
- def test_VERSION_greater_than
42
+ def test_VERSION_greater_than
43
43
 
44
- assert_operator LibPath::VERSION, :>=, '0.1.0'
45
- end
44
+ assert_operator LibPath::VERSION, :>=, '0.1.0'
45
+ end
46
46
  end
47
47
 
48
+
49
+ # ############################## end of file ############################# #
50
+
data/test/unit/ts_all.rb CHANGED
@@ -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,178 +2,183 @@
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), *(['..'] * 3), 'lib')
4
4
 
5
+
5
6
  require 'libpath/util'
6
7
 
7
8
  require 'test/unit'
8
9
 
9
10
  require 'libpath/internal_/platform'
10
11
 
12
+
11
13
  class Test_LibPath_Util_combine_paths < Test::Unit::TestCase
12
14
 
13
- F = ::LibPath::Util
15
+ F = ::LibPath::Util
14
16
 
15
- def test_no_arguments
17
+ def test_no_arguments
16
18
 
17
- assert_equal '', F.combine_paths()
18
- end
19
+ assert_equal '', F.combine_paths()
20
+ end
19
21
 
20
- def test_single_argument
22
+ def test_single_argument
21
23
 
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
24
+ assert_equal ' ', F.combine_paths(' ')
25
+ assert_equal 'a', F.combine_paths('a')
26
+ assert_equal 'abcdef/ghi/jkl.mno', F.combine_paths('abcdef/ghi/jkl.mno')
27
+ assert_equal '/', F.combine_paths('/')
28
+ end
27
29
 
28
- def test_relative_cases
30
+ def test_relative_cases
29
31
 
30
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
32
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
31
33
 
32
- assert_equal 'a\\b\\c/d', F.combine_paths('a', 'b', 'c/d')
34
+ assert_equal 'a\\b\\c/d', F.combine_paths('a', 'b', 'c/d')
33
35
 
34
- assert_equal 'a\\b', F.combine_paths('', 'a', '', '', 'b')
36
+ assert_equal 'a\\b', F.combine_paths('', 'a', '', '', 'b')
35
37
 
36
- assert_equal 'a\\ \\b', F.combine_paths('', 'a', '', ' ', 'b')
37
- else
38
+ assert_equal 'a\\ \\b', F.combine_paths('', 'a', '', ' ', 'b')
39
+ else
38
40
 
39
- assert_equal 'a/b/c/d', F.combine_paths('a', 'b', 'c/d')
41
+ assert_equal 'a/b/c/d', F.combine_paths('a', 'b', 'c/d')
40
42
 
41
- assert_equal 'a/b', F.combine_paths('', 'a', '', '', 'b')
43
+ assert_equal 'a/b', F.combine_paths('', 'a', '', '', 'b')
42
44
 
43
- assert_equal 'a/ /b', F.combine_paths('', 'a', '', ' ', 'b')
44
- end
45
- end
45
+ assert_equal 'a/ /b', F.combine_paths('', 'a', '', ' ', 'b')
46
+ end
47
+ end
46
48
 
47
- def test_tail_absolute_cases
49
+ def test_tail_absolute_cases
48
50
 
49
- assert_equal '/', F.combine_paths('a', '/')
51
+ assert_equal '/', F.combine_paths('a', '/')
50
52
 
51
- assert_equal '/', F.combine_paths('a/b/c/d', '/')
53
+ assert_equal '/', F.combine_paths('a/b/c/d', '/')
52
54
 
53
- assert_equal '/', F.combine_paths('a', 'b', '/')
55
+ assert_equal '/', F.combine_paths('a', 'b', '/')
54
56
 
55
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
57
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
56
58
 
57
- assert_equal 'X:/', F.combine_paths('a', 'X:/')
58
- assert_equal 'X:\\', F.combine_paths('a', 'X:\\')
59
- assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\\\?\\X:\\')
60
- end
61
- end
59
+ assert_equal 'X:/', F.combine_paths('a', 'X:/')
60
+ assert_equal 'X:\\', F.combine_paths('a', 'X:\\')
61
+ assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\\\?\\X:\\')
62
+ end
63
+ end
62
64
 
63
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
65
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
64
66
 
65
- def test_tail_absolute_cases_2
67
+ def test_tail_absolute_cases_2
66
68
 
67
- assert_equal 'Y:/', F.combine_paths('a', 'X:/', 'Y:/')
68
- assert_equal 'Y:\\', F.combine_paths('a', 'X:/', 'Y:\\')
69
- assert_equal 'Y:\\', F.combine_paths('a', '\\\\?\\X:/', 'Y:\\')
70
- assert_equal '\\\\?\\Y:\\', F.combine_paths('a', 'X:/', '\\\\?\\Y:\\')
71
- end
69
+ assert_equal 'Y:/', F.combine_paths('a', 'X:/', 'Y:/')
70
+ assert_equal 'Y:\\', F.combine_paths('a', 'X:/', 'Y:\\')
71
+ assert_equal 'Y:\\', F.combine_paths('a', '\\\\?\\X:/', 'Y:\\')
72
+ assert_equal '\\\\?\\Y:\\', F.combine_paths('a', 'X:/', '\\\\?\\Y:\\')
73
+ end
72
74
 
73
- def test_tail_absolute_cases_3
75
+ def test_tail_absolute_cases_3
74
76
 
75
- assert_equal 'X:\\', F.combine_paths('a', 'X:', '\\')
76
- assert_equal 'X:\\', F.combine_paths('a', '\\', 'X:')
77
- assert_equal 'X:\\', F.combine_paths('X:', 'a', '\\')
77
+ assert_equal 'X:\\', F.combine_paths('a', 'X:', '\\')
78
+ assert_equal 'X:\\', F.combine_paths('a', '\\', 'X:')
79
+ assert_equal 'X:\\', F.combine_paths('X:', 'a', '\\')
78
80
 
79
- assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\\\?\\X:', '\\')
80
- assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\', '\\\\?\\X:')
81
- assert_equal '\\\\?\\X:\\', F.combine_paths('\\\\?\\X:', 'a', '\\')
82
- end
81
+ assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\\\?\\X:', '\\')
82
+ assert_equal '\\\\?\\X:\\', F.combine_paths('a', '\\', '\\\\?\\X:')
83
+ assert_equal '\\\\?\\X:\\', F.combine_paths('\\\\?\\X:', 'a', '\\')
84
+ end
83
85
 
84
- def test_tail_absolute_cases_4
86
+ def test_tail_absolute_cases_4
85
87
 
86
- assert_equal 'Z:\\', F.combine_paths('a', 'X:/', '\\', 'Z:')
88
+ assert_equal 'Z:\\', F.combine_paths('a', 'X:/', '\\', 'Z:')
87
89
 
88
- assert_equal '\\\\?\\Z:\\', F.combine_paths('a', '\\\\?\\X:/', '\\', '\\\\?\\Z:')
90
+ assert_equal '\\\\?\\Z:\\', F.combine_paths('a', '\\\\?\\X:/', '\\', '\\\\?\\Z:')
89
91
 
90
- assert_equal '\\\\?\\UNC\\server\\share/abc', F.combine_paths('a', '\\\\?\\X:/', '/abc', '\\\\?\\UNC\\server\\share')
91
- end
92
+ assert_equal '\\\\?\\UNC\\server\\share/abc', F.combine_paths('a', '\\\\?\\X:/', '/abc', '\\\\?\\UNC\\server\\share')
93
+ end
92
94
 
93
- def test_tail_absolute_cases_5
95
+ def test_tail_absolute_cases_5
94
96
 
95
- assert_equal 'Z:\\dir\\a\\b', F.combine_paths('a', 'X:/y', '\\dir', 'Z:', 'a', 'b')
97
+ assert_equal 'Z:\\dir\\a\\b', F.combine_paths('a', 'X:/y', '\\dir', 'Z:', 'a', 'b')
96
98
 
97
- assert_equal 'Z:\\dir\\a\\b', F.combine_paths('a', '\\\\?\\X:/y', '\\dir', 'Z:', 'a', 'b')
99
+ assert_equal 'Z:\\dir\\a\\b', F.combine_paths('a', '\\\\?\\X:/y', '\\dir', 'Z:', 'a', 'b')
98
100
 
99
- assert_equal '\\\\?\\Z:\\dir\\a\\b', F.combine_paths('a', 'X:/y', '\\dir', '\\\\?\\Z:', 'a', 'b')
100
- end
101
+ assert_equal '\\\\?\\Z:\\dir\\a\\b', F.combine_paths('a', 'X:/y', '\\dir', '\\\\?\\Z:', 'a', 'b')
102
+ end
101
103
 
102
- def test_tail_absolute_cases_6
104
+ def test_tail_absolute_cases_6
103
105
 
104
- assert_equal 'Z:\\b', F.combine_paths('a', 'X:/', 'Z:', 'a', '\\', 'b')
105
- end
106
+ assert_equal 'Z:\\b', F.combine_paths('a', 'X:/', 'Z:', 'a', '\\', 'b')
107
+ end
106
108
 
107
- def test_tail_absolute_cases_7
109
+ def test_tail_absolute_cases_7
108
110
 
109
- assert_equal 'Z:\\a\\c\\b', F.combine_paths('a', 'X:/', '\\a', 'c', 'Z:', 'b')
110
- end
111
+ assert_equal 'Z:\\a\\c\\b', F.combine_paths('a', 'X:/', '\\a', 'c', 'Z:', 'b')
112
+ end
111
113
 
112
- def test_tail_absolute_cases_8
114
+ def test_tail_absolute_cases_8
113
115
 
114
- assert_equal 'X:/y\\b', F.combine_paths('a', '\\a', 'c', 'Z:', 'X:/y', 'b')
115
- end
116
+ assert_equal 'X:/y\\b', F.combine_paths('a', '\\a', 'c', 'Z:', 'X:/y', 'b')
117
+ end
116
118
 
117
- def test_tail_absolute_cases_9
119
+ def test_tail_absolute_cases_9
118
120
 
119
- assert_equal 'Z:\\y\\b', F.combine_paths('a', '\\a', 'c', 'X:\\y', 'Z:', 'b')
120
- assert_equal 'Z:/y\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', 'Z:', 'b')
121
- end
122
- end
121
+ assert_equal 'Z:\\y\\b', F.combine_paths('a', '\\a', 'c', 'X:\\y', 'Z:', 'b')
122
+ assert_equal 'Z:/y\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', 'Z:', 'b')
123
+ end
124
+ end
123
125
 
124
- def test_tail_absolute_cases_10
126
+ def test_tail_absolute_cases_10
125
127
 
126
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
128
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
127
129
 
128
- assert_equal 'X:\\dir-1\\dir-2\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', '\\dir-1\\dir-2', 'b')
129
- assert_equal 'X:\\dir-1/dir-2\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', '\\dir-1/dir-2', 'b')
130
- end
130
+ assert_equal 'X:\\dir-1\\dir-2\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', '\\dir-1\\dir-2', 'b')
131
+ assert_equal 'X:\\dir-1/dir-2\\b', F.combine_paths('a', '\\a', 'c', 'X:/y', '\\dir-1/dir-2', 'b')
132
+ end
131
133
 
132
- assert_equal '/', F.combine_paths('a', '/')
134
+ assert_equal '/', F.combine_paths('a', '/')
133
135
 
134
- assert_equal '/', F.combine_paths('a/b/c/d', '/')
136
+ assert_equal '/', F.combine_paths('a/b/c/d', '/')
135
137
 
136
- assert_equal '/', F.combine_paths('a', 'b', '/')
137
- end
138
+ assert_equal '/', F.combine_paths('a', 'b', '/')
139
+ end
138
140
 
139
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
141
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
140
142
 
141
- def test_drive_only
143
+ def test_drive_only
142
144
 
143
- assert_equal 'D:', F.combine_paths('D:')
144
- assert_equal 'D:dir-1\\dir-2', F.combine_paths('D:', 'dir-1\\dir-2')
145
+ assert_equal 'D:', F.combine_paths('D:')
146
+ assert_equal 'D:dir-1\\dir-2', F.combine_paths('D:', 'dir-1\\dir-2')
145
147
 
146
- assert_equal '\\\\?\\D:', F.combine_paths('\\\\?\\D:')
147
- assert_equal '\\\\?\\D:dir-1\\dir-2', F.combine_paths('\\\\?\\D:', 'dir-1\\dir-2')
148
- end
149
- end
148
+ assert_equal '\\\\?\\D:', F.combine_paths('\\\\?\\D:')
149
+ assert_equal '\\\\?\\D:dir-1\\dir-2', F.combine_paths('\\\\?\\D:', 'dir-1\\dir-2')
150
+ end
151
+ end
150
152
 
151
- def test_embedded_absolute_cases
153
+ def test_embedded_absolute_cases
152
154
 
153
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
155
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
154
156
 
155
- assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', 'z', '/a', 'b', 'c/d')
156
- assert_equal '\\a\\b\\c/d', F.combine_paths('x/y/z', 'z', '\\a', 'b', 'c/d')
157
- else
157
+ assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', 'z', '/a', 'b', 'c/d')
158
+ assert_equal '\\a\\b\\c/d', F.combine_paths('x/y/z', 'z', '\\a', 'b', 'c/d')
159
+ else
158
160
 
159
- assert_equal '/a/b/c/d', F.combine_paths('x/y/z', 'z', '/a', 'b', 'c/d')
160
- assert_equal '/a/b/c/d', F.combine_paths('x/y/z', 'z', '/a', 'b', 'c/d')
161
- end
162
- end
161
+ assert_equal '/a/b/c/d', F.combine_paths('x/y/z', 'z', '/a', 'b', 'c/d')
162
+ assert_equal '/a/b/c/d', F.combine_paths('x/y/z', 'z', '/a', 'b', 'c/d')
163
+ end
164
+ end
163
165
 
164
- def test_multiple_embedded_absolute_cases
166
+ def test_multiple_embedded_absolute_cases
165
167
 
166
- if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
168
+ if ::LibPath::Internal_::Platform::Constants::PLATFORM_IS_WINDOWS then
167
169
 
168
- assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
170
+ assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
169
171
 
170
- assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
171
- else
172
+ assert_equal '/a\\b\\c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
173
+ else
172
174
 
173
- assert_equal '/a/b/c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
175
+ assert_equal '/a/b/c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
174
176
 
175
- assert_equal '/a/b/c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
176
- end
177
- end
177
+ assert_equal '/a/b/c/d', F.combine_paths('x/y/z', '/z', '/a', 'b', 'c/d')
178
+ end
179
+ end
178
180
  end
179
181
 
182
+
183
+ # ############################## end of file ############################# #
184
+
@@ -2,18 +2,23 @@
2
2
 
3
3
  $:.unshift File.join(File.dirname(__FILE__), *(['..'] * 3), 'lib')
4
4
 
5
+
5
6
  require 'libpath/util'
6
7
 
7
8
  require 'test/unit'
8
9
 
9
10
  require 'libpath/internal_/platform'
10
11
 
12
+
11
13
  class Test_LibPath_Util_derive_relative_path < Test::Unit::TestCase
12
14
 
13
- F = ::LibPath::Util
15
+ F = ::LibPath::Util
14
16
 
15
- def test_nils
17
+ def test_nils
16
18
 
17
- end
19
+ end
18
20
  end
19
21
 
22
+
23
+ # ############################## end of file ############################# #
24
+