libpath-ruby 0.2.2 → 0.2.2.1

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 +71 -71
  7. data/lib/libpath/constants/windows.rb +72 -72
  8. data/lib/libpath/constants.rb +18 -19
  9. data/lib/libpath/diagnostics/parameter_checking.rb +25 -25
  10. data/lib/libpath/diagnostics.rb +1 -1
  11. data/lib/libpath/exceptions/libpath_base_exception.rb +13 -13
  12. data/lib/libpath/exceptions/malformed_name_exception.rb +23 -22
  13. data/lib/libpath/exceptions.rb +1 -1
  14. data/lib/libpath/form/unix.rb +104 -103
  15. data/lib/libpath/form/windows.rb +200 -199
  16. data/lib/libpath/form.rb +18 -18
  17. data/lib/libpath/internal_/array.rb +53 -53
  18. data/lib/libpath/internal_/platform.rb +24 -24
  19. data/lib/libpath/internal_/string.rb +18 -18
  20. data/lib/libpath/internal_/unix/form.rb +116 -116
  21. data/lib/libpath/internal_/windows/drive.rb +59 -59
  22. data/lib/libpath/internal_/windows/form.rb +189 -189
  23. data/lib/libpath/libpath.rb +3 -0
  24. data/lib/libpath/path/unix.rb +114 -112
  25. data/lib/libpath/path/windows.rb +120 -118
  26. data/lib/libpath/path.rb +18 -20
  27. data/lib/libpath/util/unix.rb +258 -258
  28. data/lib/libpath/util/windows.rb +400 -400
  29. data/lib/libpath/util.rb +18 -19
  30. data/lib/libpath/version.rb +23 -24
  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,122 +2,127 @@
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_derive_relative_path < Test::Unit::TestCase
10
12
 
11
- M = ::LibPath::Util::Unix
13
+ M = ::LibPath::Util::Unix
12
14
 
13
- def test_nils_and_empties
15
+ def test_nils_and_empties
14
16
 
15
- # to get nowhere from nowhere, go nowhere
16
- assert_nil M.derive_relative_path(nil, nil)
17
- assert_nil M.derive_relative_path('', nil)
18
- assert_equal '', M.derive_relative_path('', '')
19
- assert_equal '', M.derive_relative_path(nil, '')
17
+ # to get nowhere from nowhere, go nowhere
18
+ assert_nil M.derive_relative_path(nil, nil)
19
+ assert_nil M.derive_relative_path('', nil)
20
+ assert_equal '', M.derive_relative_path('', '')
21
+ assert_equal '', M.derive_relative_path(nil, '')
20
22
 
21
- # to get somewhere from nowhere, just go there
22
- assert_equal 'abc', M.derive_relative_path(nil, 'abc')
23
- assert_equal 'abc', M.derive_relative_path('', 'abc')
23
+ # to get somewhere from nowhere, just go there
24
+ assert_equal 'abc', M.derive_relative_path(nil, 'abc')
25
+ assert_equal 'abc', M.derive_relative_path('', 'abc')
24
26
 
25
- # to get nowhere from anywhere else, go nowhere
26
- assert_nil M.derive_relative_path('dir', nil)
27
- assert_equal '', M.derive_relative_path('dir', '')
28
- end
27
+ # to get nowhere from anywhere else, go nowhere
28
+ assert_nil M.derive_relative_path('dir', nil)
29
+ assert_equal '', M.derive_relative_path('dir', '')
30
+ end
29
31
 
30
- def test_same_location
32
+ def test_same_location
31
33
 
32
- assert_equal '.', M.derive_relative_path('.', '.')
33
- assert_equal '.', M.derive_relative_path('..', '..')
34
+ assert_equal '.', M.derive_relative_path('.', '.')
35
+ assert_equal '.', M.derive_relative_path('..', '..')
34
36
 
35
- assert_equal '.', M.derive_relative_path('abc', 'abc')
36
- assert_equal './', M.derive_relative_path('abc/', 'abc/')
37
- assert_equal './', M.derive_relative_path('abc', 'abc/')
37
+ assert_equal '.', M.derive_relative_path('abc', 'abc')
38
+ assert_equal './', M.derive_relative_path('abc/', 'abc/')
39
+ assert_equal './', M.derive_relative_path('abc', 'abc/')
38
40
 
39
- assert_equal './', M.derive_relative_path('/', '/')
41
+ assert_equal './', M.derive_relative_path('/', '/')
40
42
 
41
- assert_equal '.', M.derive_relative_path('./abc', 'abc')
42
- assert_equal '.', M.derive_relative_path('./abc/', 'abc')
43
- assert_equal './', M.derive_relative_path('./abc', 'abc/')
44
- assert_equal './', M.derive_relative_path('./abc/', 'abc/')
43
+ assert_equal '.', M.derive_relative_path('./abc', 'abc')
44
+ assert_equal '.', M.derive_relative_path('./abc/', 'abc')
45
+ assert_equal './', M.derive_relative_path('./abc', 'abc/')
46
+ assert_equal './', M.derive_relative_path('./abc/', 'abc/')
45
47
 
46
- assert_equal '.', M.derive_relative_path('/abc', '/abc')
47
- assert_equal '.', M.derive_relative_path('/abc/', '/abc')
48
- assert_equal './', M.derive_relative_path('/abc/', '/abc/')
49
- assert_equal '../', M.derive_relative_path('/abc/', '/')
48
+ assert_equal '.', M.derive_relative_path('/abc', '/abc')
49
+ assert_equal '.', M.derive_relative_path('/abc/', '/abc')
50
+ assert_equal './', M.derive_relative_path('/abc/', '/abc/')
51
+ assert_equal '../', M.derive_relative_path('/abc/', '/')
50
52
 
51
- assert_equal '../../', M.derive_relative_path('/abc/def/', '/')
52
- assert_equal '../../', M.derive_relative_path('/abc/def/', '/')
53
- end
53
+ assert_equal '../../', M.derive_relative_path('/abc/def/', '/')
54
+ assert_equal '../../', M.derive_relative_path('/abc/def/', '/')
55
+ end
54
56
 
55
- def test_from_here
57
+ def test_from_here
56
58
 
57
- assert_equal 'abc', M.derive_relative_path('.', 'abc')
58
- assert_equal 'abc', M.derive_relative_path('./', 'abc')
59
- assert_equal 'abc/', M.derive_relative_path('.', 'abc/')
60
- assert_equal 'abc/', M.derive_relative_path('./', 'abc/')
59
+ assert_equal 'abc', M.derive_relative_path('.', 'abc')
60
+ assert_equal 'abc', M.derive_relative_path('./', 'abc')
61
+ assert_equal 'abc/', M.derive_relative_path('.', 'abc/')
62
+ assert_equal 'abc/', M.derive_relative_path('./', 'abc/')
61
63
 
62
- assert_equal('abc/', M.derive_relative_path('/dir1/dir2', '/dir1/dir2/abc/'))
63
- assert_equal('.', M.derive_relative_path('/dir1/dir2/abc', '/dir1/dir2/abc'))
64
- assert_equal('./', M.derive_relative_path('/dir1/dir2/abc', '/dir1/dir2/abc/'))
65
- end
64
+ assert_equal('abc/', M.derive_relative_path('/dir1/dir2', '/dir1/dir2/abc/'))
65
+ assert_equal('.', M.derive_relative_path('/dir1/dir2/abc', '/dir1/dir2/abc'))
66
+ assert_equal('./', M.derive_relative_path('/dir1/dir2/abc', '/dir1/dir2/abc/'))
67
+ end
66
68
 
67
- def test_ones_above
69
+ def test_ones_above
68
70
 
69
- assert_equal '../', M.derive_relative_path('.', '..')
71
+ assert_equal '../', M.derive_relative_path('.', '..')
70
72
 
71
- assert_equal '../', M.derive_relative_path('abc/def', 'abc')
73
+ assert_equal '../', M.derive_relative_path('abc/def', 'abc')
72
74
 
73
- assert_equal '../', M.derive_relative_path('abc/def/ghi', 'abc/def')
74
- assert_equal '../', M.derive_relative_path('abc/def/ghi', 'abc/def/')
75
+ assert_equal '../', M.derive_relative_path('abc/def/ghi', 'abc/def')
76
+ assert_equal '../', M.derive_relative_path('abc/def/ghi', 'abc/def/')
75
77
 
76
- assert_equal '../', M.derive_relative_path('abc/def/./ghi', 'abc/def')
77
- assert_equal '../', M.derive_relative_path('abc/def/ghi/jkl/..', 'abc/def')
78
- assert_equal '../', M.derive_relative_path('abc/def/ghi/jkl/../', 'abc/def')
79
- assert_equal '../', M.derive_relative_path('abc/def/ghi/jkl/..', 'abc/def/')
78
+ assert_equal '../', M.derive_relative_path('abc/def/./ghi', 'abc/def')
79
+ assert_equal '../', M.derive_relative_path('abc/def/ghi/jkl/..', 'abc/def')
80
+ assert_equal '../', M.derive_relative_path('abc/def/ghi/jkl/../', 'abc/def')
81
+ assert_equal '../', M.derive_relative_path('abc/def/ghi/jkl/..', 'abc/def/')
80
82
 
81
- assert_equal '../../', M.derive_relative_path('abc/def/ghi/jkl/', 'abc/def')
83
+ assert_equal '../../', M.derive_relative_path('abc/def/ghi/jkl/', 'abc/def')
82
84
 
83
- assert_equal '../../', M.derive_relative_path('/dir1/dir2/dir3/dir4', '/dir1/dir2')
84
- end
85
+ assert_equal '../../', M.derive_relative_path('/dir1/dir2/dir3/dir4', '/dir1/dir2')
86
+ end
85
87
 
86
- def test_ones_below
88
+ def test_ones_below
87
89
 
88
- assert_equal 'dir-1/', M.derive_relative_path('..', '.', pwd: '/dir-1/')
90
+ assert_equal 'dir-1/', M.derive_relative_path('..', '.', pwd: '/dir-1/')
89
91
 
90
- assert_equal '../', M.derive_relative_path('.', '..', pwd: '/dir-1/')
92
+ assert_equal '../', M.derive_relative_path('.', '..', pwd: '/dir-1/')
91
93
 
92
- assert_equal 'def', M.derive_relative_path('abc', 'abc/def')
94
+ assert_equal 'def', M.derive_relative_path('abc', 'abc/def')
93
95
 
94
- assert_equal 'def/ghi', M.derive_relative_path('abc', 'abc/def/ghi')
95
- end
96
+ assert_equal 'def/ghi', M.derive_relative_path('abc', 'abc/def/ghi')
97
+ end
96
98
 
97
- def test_ones_across
99
+ def test_ones_across
98
100
 
99
- assert_equal '../e-1', M.derive_relative_path('abc/d-1', 'abc/e-1')
100
- assert_equal '../e-1', M.derive_relative_path('abc/d-1/', 'abc/e-1')
101
+ assert_equal '../e-1', M.derive_relative_path('abc/d-1', 'abc/e-1')
102
+ assert_equal '../e-1', M.derive_relative_path('abc/d-1/', 'abc/e-1')
101
103
 
102
- assert_equal '../e-1/e-2', M.derive_relative_path('abc/d-1/', 'abc/e-1/e-2')
103
- assert_equal '../../e-1/e-2', M.derive_relative_path('abc/d-1/d-2/', 'abc/e-1/e-2')
104
- end
104
+ assert_equal '../e-1/e-2', M.derive_relative_path('abc/d-1/', 'abc/e-1/e-2')
105
+ assert_equal '../../e-1/e-2', M.derive_relative_path('abc/d-1/d-2/', 'abc/e-1/e-2')
106
+ end
105
107
 
106
- def test_simple_cases
108
+ def test_simple_cases
107
109
 
108
- assert_equal 'def', M.derive_relative_path('/abc', '/abc/def')
109
- end
110
+ assert_equal 'def', M.derive_relative_path('/abc', '/abc/def')
111
+ end
110
112
 
111
- def test_absolute_path_cases
113
+ def test_absolute_path_cases
112
114
 
113
- assert_equal '../../def', M.derive_relative_path('ghi', '/def', pwd: '/abc')
115
+ assert_equal '../../def', M.derive_relative_path('ghi', '/def', pwd: '/abc')
114
116
 
115
- assert_equal '../def', M.derive_relative_path('abc', '/def', pwd: '/')
116
- end
117
+ assert_equal '../def', M.derive_relative_path('abc', '/def', pwd: '/')
118
+ end
117
119
 
118
- def test_both_relative
120
+ def test_both_relative
119
121
 
120
- assert_equal '../def', M.derive_relative_path('abc', 'def', pwd: '/')
121
- end
122
+ assert_equal '../def', M.derive_relative_path('abc', 'def', pwd: '/')
123
+ end
122
124
  end
123
125
 
126
+
127
+ # ############################## end of file ############################# #
128
+
@@ -2,116 +2,120 @@
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
 
9
- class Test_LibPath_Util_Unix_make_path_absolute < Test::Unit::TestCase
10
10
 
11
- F = ::LibPath::Util::Unix
11
+ class Test_LibPath_Util_Unix_make_path_absolute < Test::Unit::TestCase
12
12
 
13
- def test_nil
13
+ F = ::LibPath::Util::Unix
14
14
 
15
- if $DEBUG
15
+ def test_nil
16
16
 
17
- assert_raise(::ArgumentError) { F.make_path_absolute(nil) }
18
- else
17
+ if $DEBUG
19
18
 
20
- assert_nil F.make_path_absolute(nil)
21
- end
22
- end
19
+ assert_raise(::ArgumentError) { F.make_path_absolute(nil) }
20
+ else
23
21
 
24
- def test_empty
22
+ assert_nil F.make_path_absolute(nil)
23
+ end
24
+ end
25
25
 
26
- assert_equal '', F.make_path_absolute('')
27
- end
26
+ def test_empty
28
27
 
29
- def test_absolute_paths
28
+ assert_equal '', F.make_path_absolute('')
29
+ end
30
30
 
31
- assert_equal '/', F.make_path_absolute('/')
32
- assert_equal '/.', F.make_path_absolute('/.')
33
- assert_equal '/a', F.make_path_absolute('/a')
34
- assert_equal '/a/.', F.make_path_absolute('/a/.')
35
- end
31
+ def test_absolute_paths
36
32
 
37
- def test_absolute_paths_with_canonicalisation
33
+ assert_equal '/', F.make_path_absolute('/')
34
+ assert_equal '/.', F.make_path_absolute('/.')
35
+ assert_equal '/a', F.make_path_absolute('/a')
36
+ assert_equal '/a/.', F.make_path_absolute('/a/.')
37
+ end
38
38
 
39
- options = { make_canonical: true }
39
+ def test_absolute_paths_with_canonicalisation
40
40
 
41
- assert_equal '/', F.make_path_absolute('/', **options)
42
- assert_equal '/', F.make_path_absolute('/.', **options)
43
- assert_equal '/a', F.make_path_absolute('/a', **options)
44
- assert_equal '/a/', F.make_path_absolute('/a/.', **options)
45
- end
41
+ options = { make_canonical: true }
46
42
 
47
- def test_relative_path_with_fixed_pwd
43
+ assert_equal '/', F.make_path_absolute('/', **options)
44
+ assert_equal '/', F.make_path_absolute('/.', **options)
45
+ assert_equal '/a', F.make_path_absolute('/a', **options)
46
+ assert_equal '/a/', F.make_path_absolute('/a/.', **options)
47
+ end
48
48
 
49
- pwd = '/some-path/or-other'
49
+ def test_relative_path_with_fixed_pwd
50
50
 
51
- assert_equal '/some-path/or-other/.', F.make_path_absolute('.', pwd: pwd)
52
- assert_equal '/some-path/or-other/', F.make_path_absolute('.', pwd: pwd, make_canonical: true)
51
+ pwd = '/some-path/or-other'
53
52
 
54
- assert_equal '/some-path/or-other/abc', F.make_path_absolute('abc', pwd: pwd)
55
- assert_equal '/some-path/or-other/abc', F.make_path_absolute('abc', pwd: pwd, make_canonical: true)
53
+ assert_equal '/some-path/or-other/.', F.make_path_absolute('.', pwd: pwd)
54
+ assert_equal '/some-path/or-other/', F.make_path_absolute('.', pwd: pwd, make_canonical: true)
56
55
 
57
- assert_equal '/some-path/or-other/./abc', F.make_path_absolute('./abc', pwd: pwd)
58
- assert_equal '/some-path/or-other/abc', F.make_path_absolute('./abc', pwd: pwd, make_canonical: true)
56
+ assert_equal '/some-path/or-other/abc', F.make_path_absolute('abc', pwd: pwd)
57
+ assert_equal '/some-path/or-other/abc', F.make_path_absolute('abc', pwd: pwd, make_canonical: true)
59
58
 
60
- assert_equal '/some-path/or-other/./abc/', F.make_path_absolute('./abc/', pwd: pwd)
61
- assert_equal '/some-path/or-other/abc/', F.make_path_absolute('./abc/', pwd: pwd, make_canonical: true)
59
+ assert_equal '/some-path/or-other/./abc', F.make_path_absolute('./abc', pwd: pwd)
60
+ assert_equal '/some-path/or-other/abc', F.make_path_absolute('./abc', pwd: pwd, make_canonical: true)
62
61
 
63
- assert_equal '/some-path/or-other/def/../abc', F.make_path_absolute('def/../abc', pwd: pwd)
64
- assert_equal '/some-path/or-other/abc', F.make_path_absolute('def/../abc', pwd: pwd, make_canonical: true)
62
+ assert_equal '/some-path/or-other/./abc/', F.make_path_absolute('./abc/', pwd: pwd)
63
+ assert_equal '/some-path/or-other/abc/', F.make_path_absolute('./abc/', pwd: pwd, make_canonical: true)
65
64
 
66
- assert_equal '/some-path/or-other/def/../abc/', F.make_path_absolute('def/../abc/', pwd: pwd)
67
- assert_equal '/some-path/or-other/abc/', F.make_path_absolute('def/../abc/', pwd: pwd, make_canonical: true)
68
- end
65
+ assert_equal '/some-path/or-other/def/../abc', F.make_path_absolute('def/../abc', pwd: pwd)
66
+ assert_equal '/some-path/or-other/abc', F.make_path_absolute('def/../abc', pwd: pwd, make_canonical: true)
69
67
 
70
- def test_relative_path_with_fixed_home
68
+ assert_equal '/some-path/or-other/def/../abc/', F.make_path_absolute('def/../abc/', pwd: pwd)
69
+ assert_equal '/some-path/or-other/abc/', F.make_path_absolute('def/../abc/', pwd: pwd, make_canonical: true)
70
+ end
71
71
 
72
- home = '/Users/libpath-tester'
72
+ def test_relative_path_with_fixed_home
73
73
 
74
- assert_equal '/Users/libpath-tester/.', F.make_path_absolute('~/.', home: home)
75
- assert_equal '/Users/libpath-tester/', F.make_path_absolute('~/.', home: home, make_canonical: true)
74
+ home = '/Users/libpath-tester'
76
75
 
77
- assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/abc', home: home)
78
- assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/abc', home: home, make_canonical: true)
76
+ assert_equal '/Users/libpath-tester/.', F.make_path_absolute('~/.', home: home)
77
+ assert_equal '/Users/libpath-tester/', F.make_path_absolute('~/.', home: home, make_canonical: true)
79
78
 
80
- assert_equal '/Users/libpath-tester/./abc', F.make_path_absolute('~/./abc', home: home)
81
- assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/./abc', home: home, make_canonical: true)
79
+ assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/abc', home: home)
80
+ assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/abc', home: home, make_canonical: true)
82
81
 
83
- assert_equal '/Users/libpath-tester/./abc/', F.make_path_absolute('~/./abc/', home: home)
84
- assert_equal '/Users/libpath-tester/abc/', F.make_path_absolute('~/./abc/', home: home, make_canonical: true)
82
+ assert_equal '/Users/libpath-tester/./abc', F.make_path_absolute('~/./abc', home: home)
83
+ assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/./abc', home: home, make_canonical: true)
85
84
 
86
- assert_equal '/Users/libpath-tester/def/../abc', F.make_path_absolute('~/def/../abc', home: home)
87
- assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/def/../abc', home: home, make_canonical: true)
85
+ assert_equal '/Users/libpath-tester/./abc/', F.make_path_absolute('~/./abc/', home: home)
86
+ assert_equal '/Users/libpath-tester/abc/', F.make_path_absolute('~/./abc/', home: home, make_canonical: true)
88
87
 
89
- assert_equal '/Users/libpath-tester/def/../abc/', F.make_path_absolute('~/def/../abc/', home: home)
90
- assert_equal '/Users/libpath-tester/abc/', F.make_path_absolute('~/def/../abc/', home: home, make_canonical: true)
91
- end
88
+ assert_equal '/Users/libpath-tester/def/../abc', F.make_path_absolute('~/def/../abc', home: home)
89
+ assert_equal '/Users/libpath-tester/abc', F.make_path_absolute('~/def/../abc', home: home, make_canonical: true)
92
90
 
93
- def test_nonhome_tilde_with_fixed_pwd
91
+ assert_equal '/Users/libpath-tester/def/../abc/', F.make_path_absolute('~/def/../abc/', home: home)
92
+ assert_equal '/Users/libpath-tester/abc/', F.make_path_absolute('~/def/../abc/', home: home, make_canonical: true)
93
+ end
94
94
 
95
- pwd = '/some-path/or-other'
95
+ def test_nonhome_tilde_with_fixed_pwd
96
96
 
97
- assert_equal '/some-path/or-other/~.', F.make_path_absolute('~.', pwd: pwd)
98
- assert_equal '/some-path/or-other/~.', F.make_path_absolute('~.', pwd: pwd, make_canonical: true)
97
+ pwd = '/some-path/or-other'
99
98
 
100
- assert_equal '/some-path/or-other/~abc', F.make_path_absolute('~abc', pwd: pwd)
101
- assert_equal '/some-path/or-other/~abc', F.make_path_absolute('~abc', pwd: pwd, make_canonical: true)
99
+ assert_equal '/some-path/or-other/~.', F.make_path_absolute('~.', pwd: pwd)
100
+ assert_equal '/some-path/or-other/~.', F.make_path_absolute('~.', pwd: pwd, make_canonical: true)
102
101
 
103
- assert_equal '/some-path/or-other/~./abc', F.make_path_absolute('~./abc', pwd: pwd)
104
- assert_equal '/some-path/or-other/~./abc', F.make_path_absolute('~./abc', pwd: pwd, make_canonical: true)
102
+ assert_equal '/some-path/or-other/~abc', F.make_path_absolute('~abc', pwd: pwd)
103
+ assert_equal '/some-path/or-other/~abc', F.make_path_absolute('~abc', pwd: pwd, make_canonical: true)
105
104
 
106
- assert_equal '/some-path/or-other/~./abc/', F.make_path_absolute('~./abc/', pwd: pwd)
107
- assert_equal '/some-path/or-other/~./abc/', F.make_path_absolute('~./abc/', pwd: pwd, make_canonical: true)
105
+ assert_equal '/some-path/or-other/~./abc', F.make_path_absolute('~./abc', pwd: pwd)
106
+ assert_equal '/some-path/or-other/~./abc', F.make_path_absolute('~./abc', pwd: pwd, make_canonical: true)
108
107
 
109
- assert_equal '/some-path/or-other/~def/../abc', F.make_path_absolute('~def/../abc', pwd: pwd)
110
- assert_equal '/some-path/or-other/abc', F.make_path_absolute('~def/../abc', pwd: pwd, make_canonical: true)
108
+ assert_equal '/some-path/or-other/~./abc/', F.make_path_absolute('~./abc/', pwd: pwd)
109
+ assert_equal '/some-path/or-other/~./abc/', F.make_path_absolute('~./abc/', pwd: pwd, make_canonical: true)
111
110
 
112
- assert_equal '/some-path/or-other/~def/../abc/', F.make_path_absolute('~def/../abc/', pwd: pwd)
113
- assert_equal '/some-path/or-other/abc/', F.make_path_absolute('~def/../abc/', pwd: pwd, make_canonical: true)
114
- end
111
+ assert_equal '/some-path/or-other/~def/../abc', F.make_path_absolute('~def/../abc', pwd: pwd)
112
+ assert_equal '/some-path/or-other/abc', F.make_path_absolute('~def/../abc', pwd: pwd, make_canonical: true)
115
113
 
114
+ assert_equal '/some-path/or-other/~def/../abc/', F.make_path_absolute('~def/../abc/', pwd: pwd)
115
+ assert_equal '/some-path/or-other/abc/', F.make_path_absolute('~def/../abc/', pwd: pwd, make_canonical: true)
116
+ end
116
117
  end
117
118
 
119
+
120
+ # ############################## end of file ############################# #
121
+