This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
File::Spec::VMS->canonpath() incorrect with ODS-5 style directory specs.
[perl5.git] / dist / PathTools / t / Spec.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Test::More;
5
6 require_ok('File::Spec');
7
8 require Cwd;
9
10 my $vms_unix_rpt;
11
12 if ($^O eq 'VMS') {
13     if (eval 'require VMS::Feature') {
14         $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
15     } else {
16         my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
17         $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i; 
18     }
19 }
20
21
22 my $skip_exception = "Needs VMS::Filespec (and thus VMS)" ;
23
24 eval {
25    require VMS::Filespec ;
26 } ;
27
28 if ( $@ ) {
29    # Not pretty, but it allows testing of things not implemented solely
30    # on VMS.  It might be better to change File::Spec::VMS to do this,
31    # making it more usable when running on (say) Unix but working with
32    # VMS paths.
33    eval qq-
34       sub File::Spec::VMS::vmsify  { die "$skip_exception" }
35       sub File::Spec::VMS::unixify { die "$skip_exception" }
36       sub File::Spec::VMS::vmspath { die "$skip_exception" }
37    - ;
38    $INC{"VMS/Filespec.pm"} = 1 ;
39 }
40
41 foreach (qw(Unix Win32 VMS OS2 Mac Epoc Cygwin)) {
42     require_ok("File::Spec::$_");
43 }
44
45 # Each element in this array is a single test. Storing them this way makes
46 # maintenance easy, and should be OK since perl should be pretty functional
47 # before these tests are run.
48
49 my @tests = (
50 # [ Function          ,            Expected          ,         Platform ]
51
52 [ "Unix->case_tolerant()",         '0'  ],
53
54 [ "Unix->catfile('a','b','c')",         'a/b/c'  ],
55 [ "Unix->catfile('a','b','./c')",       'a/b/c'  ],
56 [ "Unix->catfile('./a','b','c')",       'a/b/c'  ],
57 [ "Unix->catfile('c')",                 'c' ],
58 [ "Unix->catfile('./c')",               'c' ],
59 [ "Unix->catfile('a', 'b'.chr(0xaf))",         'a/b'.chr(0xaf)   ],
60 ($] >= 5.008 ? (
61 [ "Unix->catfile('a', do { my \$x = 'b'.chr(0xaf); use utf8 (); utf8::upgrade(\$x); \$x })",   'a/b'.chr(0xaf)   ],
62 ) : ()),
63 [ "Unix->catfile(substr('foo', 2))", 'o' ],
64
65 [ "Unix->splitpath('file')",            ',,file'            ],
66 [ "Unix->splitpath('/d1/d2/d3/')",      ',/d1/d2/d3/,'      ],
67 [ "Unix->splitpath('d1/d2/d3/')",       ',d1/d2/d3/,'       ],
68 [ "Unix->splitpath('/d1/d2/d3/.')",     ',/d1/d2/d3/.,'     ],
69 [ "Unix->splitpath('/d1/d2/d3/..')",    ',/d1/d2/d3/..,'    ],
70 [ "Unix->splitpath('/d1/d2/d3/.file')", ',/d1/d2/d3/,.file' ],
71 [ "Unix->splitpath('d1/d2/d3/file')",   ',d1/d2/d3/,file'   ],
72 [ "Unix->splitpath('/../../d1/')",      ',/../../d1/,'      ],
73 [ "Unix->splitpath('/././d1/')",        ',/././d1/,'        ],
74
75 [ "Unix->catpath('','','file')",            'file'            ],
76 [ "Unix->catpath('','/d1/d2/d3/','')",      '/d1/d2/d3/'      ],
77 [ "Unix->catpath('','d1/d2/d3/','')",       'd1/d2/d3/'       ],
78 [ "Unix->catpath('','/d1/d2/d3/.','')",     '/d1/d2/d3/.'     ],
79 [ "Unix->catpath('','/d1/d2/d3/..','')",    '/d1/d2/d3/..'    ],
80 [ "Unix->catpath('','/d1/d2/d3/','.file')", '/d1/d2/d3/.file' ],
81 [ "Unix->catpath('','d1/d2/d3/','file')",   'd1/d2/d3/file'   ],
82 [ "Unix->catpath('','/../../d1/','')",      '/../../d1/'      ],
83 [ "Unix->catpath('','/././d1/','')",        '/././d1/'        ],
84 [ "Unix->catpath('d1','d2/d3/','')",        'd2/d3/'          ],
85 [ "Unix->catpath('d1','d2','d3/')",         'd2/d3/'          ],
86
87 [ "Unix->splitdir('')",           ''           ],
88 [ "Unix->splitdir('/d1/d2/d3/')", ',d1,d2,d3,' ],
89 [ "Unix->splitdir('d1/d2/d3/')",  'd1,d2,d3,'  ],
90 [ "Unix->splitdir('/d1/d2/d3')",  ',d1,d2,d3'  ],
91 [ "Unix->splitdir('d1/d2/d3')",   'd1,d2,d3'   ],
92
93 [ "Unix->catdir()",                     ''          ],
94 [ "Unix->catdir('')",                   '/'         ],
95 [ "Unix->catdir('/')",                  '/'         ],
96 [ "Unix->catdir('','d1','d2','d3','')", '/d1/d2/d3' ],
97 [ "Unix->catdir('d1','d2','d3','')",    'd1/d2/d3'  ],
98 [ "Unix->catdir('','d1','d2','d3')",    '/d1/d2/d3' ],
99 [ "Unix->catdir('d1','d2','d3')",       'd1/d2/d3'  ],
100 # QNX is POSIXly special
101 [ "Unix->catdir('/','d2/d3')",          ( $^O =~ m!^(nto|qnx)! ? '//d2/d3' : '/d2/d3' ) ],
102 [ "Unix->catdir('a', 'b'.chr(0xaf))",         'a/b'.chr(0xaf)   ],
103 ($] >= 5.008 ? (
104 [ "Unix->catdir('a', do { my \$x = 'b'.chr(0xaf); use utf8 (); utf8::upgrade(\$x); \$x })",   'a/b'.chr(0xaf)   ],
105 ) : ()),
106
107 [ "Unix->canonpath('///../../..//./././a//b/.././c/././')",   '/a/b/../c' ],
108 [ "Unix->canonpath('')",                       ''               ],
109 # rt.perl.org 27052
110 [ "Unix->canonpath('a/../../b/c')",            'a/../../b/c'    ],
111 [ "Unix->canonpath('/')",                      '/'              ],
112 [ "Unix->canonpath('///')",                    '/'              ],
113 [ "Unix->canonpath('/.')",                     '/'              ],
114 [ "Unix->canonpath('/./')",                    '/'              ],
115 [ "Unix->canonpath('///.')",                   '/'              ],
116 [ "Unix->canonpath('///.///')",                '/'              ],
117 [ "Unix->canonpath('///..')",                  '/'              ],
118 [ "Unix->canonpath('///..///')",               '/'              ],
119 [ "Unix->canonpath('///..///.///..///')",      '/'              ],
120 [ "Unix->canonpath('.')",                      '.'              ],
121 [ "Unix->canonpath('.///')",                   '.'              ],
122 [ "Unix->canonpath('.///.')",                  '.'              ],
123 [ "Unix->canonpath('.///.///')",               '.'              ],
124 [ "Unix->canonpath('..')",                     '..'             ],
125 [ "Unix->canonpath('..///')",                  '..'             ],
126 [ "Unix->canonpath('../..')",                  '../..'          ],
127 [ "Unix->canonpath('../../')",                 '../..'          ],
128 [ "Unix->canonpath('..///.///..///')",         '../..'          ],
129 [ "Unix->canonpath('///../../..//./././a//b/.././c/././')",   '/a/b/../c' ],
130 [ "Unix->canonpath('a/../../b/c')",            'a/../../b/c'    ],
131 [ "Unix->canonpath('a///..///..///b////c')",   'a/../../b/c'    ],
132 [ "Unix->canonpath('.///a///.///..///.///..///.///b///.////c///.')",   'a/../../b/c'    ],
133 [ "Unix->canonpath('/a/./')",                  '/a'             ],
134 [ "Unix->canonpath('/a/.')",                   '/a'             ],
135 [ "Unix->canonpath('/../../')",                '/'              ],
136 [ "Unix->canonpath('/../..')",                 '/'              ],
137 [ "Unix->canonpath('/foo', '/bar')",           '/foo'           ],
138 [ "Unix->canonpath('///a'.chr(0xaf))",         '/a'.chr(0xaf)   ],
139 ($] >= 5.008 ? (
140 [ "Unix->canonpath(do { my \$x = '///a'.chr(0xaf); use utf8 (); utf8::upgrade(\$x); \$x })",   '/a'.chr(0xaf)   ],
141 ) : ()),
142
143 [  "Unix->abs2rel('/t1/t2/t3','/t1/t2/t3')",          '.'                  ],
144 [  "Unix->abs2rel('/t1/t2/t4','/t1/t2/t3')",          '../t4'              ],
145 [  "Unix->abs2rel('/t1/t2','/t1/t2/t3')",             '..'                 ],
146 [  "Unix->abs2rel('/t1/t2/t3/t4','/t1/t2/t3')",       't4'                 ],
147 [  "Unix->abs2rel('/t4/t5/t6','/t1/t2/t3')",          '../../../t4/t5/t6'  ],
148 #[ "Unix->abs2rel('../t4','/t1/t2/t3')",              '../t4'              ],
149 [  "Unix->abs2rel('/','/t1/t2/t3')",                  '../../..'           ],
150 [  "Unix->abs2rel('///','/t1/t2/t3')",                '../../..'           ],
151 [  "Unix->abs2rel('/.','/t1/t2/t3')",                 '../../..'           ],
152 [  "Unix->abs2rel('/./','/t1/t2/t3')",                '../../..'           ],
153 #[ "Unix->abs2rel('../t4','/t1/t2/t3')",              '../t4'              ],
154 [  "Unix->abs2rel('/t1/t2/t3', '/')",                 't1/t2/t3'           ],
155 [  "Unix->abs2rel('/t1/t2/t3', '/t1')",               't2/t3'              ],
156 [  "Unix->abs2rel('t1/t2/t3', 't1')",                 't2/t3'              ],
157 [  "Unix->abs2rel('t1/t2/t3', 't4')",                 '../t1/t2/t3'        ],
158  [  "Unix->abs2rel('.', '.')",                         '.'                  ],
159  [  "Unix->abs2rel('/', '/')",                         '.'                  ],
160  [  "Unix->abs2rel('../t1', 't2/t3')",                 '../../../t1'        ],
161  [  "Unix->abs2rel('t1', 't2/../t3')",                 '../t1'              ],
162
163 [ "Unix->rel2abs('t4','/t1/t2/t3')",             '/t1/t2/t3/t4'    ],
164 [ "Unix->rel2abs('t4/t5','/t1/t2/t3')",          '/t1/t2/t3/t4/t5' ],
165 [ "Unix->rel2abs('.','/t1/t2/t3')",              '/t1/t2/t3'       ],
166 [ "Unix->rel2abs('..','/t1/t2/t3')",             '/t1/t2/t3/..'    ],
167 [ "Unix->rel2abs('../t4','/t1/t2/t3')",          '/t1/t2/t3/../t4' ],
168 [ "Unix->rel2abs('/t1','/t1/t2/t3')",            '/t1'             ],
169
170 [ "Win32->case_tolerant()",         '1'  ],
171 [ "Win32->rootdir()",               '\\'  ],
172
173 [ "Win32->splitpath('file')",                            ',,file'                            ],
174 [ "Win32->splitpath('\\d1/d2\\d3/')",                    ',\\d1/d2\\d3/,'                    ],
175 [ "Win32->splitpath('d1/d2\\d3/')",                      ',d1/d2\\d3/,'                      ],
176 [ "Win32->splitpath('\\d1/d2\\d3/.')",                   ',\\d1/d2\\d3/.,'                   ],
177 [ "Win32->splitpath('\\d1/d2\\d3/..')",                  ',\\d1/d2\\d3/..,'                  ],
178 [ "Win32->splitpath('\\d1/d2\\d3/.file')",               ',\\d1/d2\\d3/,.file'               ],
179 [ "Win32->splitpath('\\d1/d2\\d3/file')",                ',\\d1/d2\\d3/,file'                ],
180 [ "Win32->splitpath('d1/d2\\d3/file')",                  ',d1/d2\\d3/,file'                  ],
181 [ "Win32->splitpath('C:\\d1/d2\\d3/')",                  'C:,\\d1/d2\\d3/,'                  ],
182 [ "Win32->splitpath('C:d1/d2\\d3/')",                    'C:,d1/d2\\d3/,'                    ],
183 [ "Win32->splitpath('C:\\d1/d2\\d3/file')",              'C:,\\d1/d2\\d3/,file'              ],
184 [ "Win32->splitpath('C:d1/d2\\d3/file')",                'C:,d1/d2\\d3/,file'                ],
185 [ "Win32->splitpath('C:\\../d2\\d3/file')",              'C:,\\../d2\\d3/,file'              ],
186 [ "Win32->splitpath('C:../d2\\d3/file')",                'C:,../d2\\d3/,file'                ],
187 [ "Win32->splitpath('\\../..\\d1/')",                    ',\\../..\\d1/,'                    ],
188 [ "Win32->splitpath('\\./.\\d1/')",                      ',\\./.\\d1/,'                      ],
189 [ "Win32->splitpath('\\\\node\\share\\d1/d2\\d3/')",     '\\\\node\\share,\\d1/d2\\d3/,'     ],
190 [ "Win32->splitpath('\\\\node\\share\\d1/d2\\d3/file')", '\\\\node\\share,\\d1/d2\\d3/,file' ],
191 [ "Win32->splitpath('\\\\node\\share\\d1/d2\\file')",    '\\\\node\\share,\\d1/d2\\,file'    ],
192 [ "Win32->splitpath('file',1)",                          ',file,'                            ],
193 [ "Win32->splitpath('\\d1/d2\\d3/',1)",                  ',\\d1/d2\\d3/,'                    ],
194 [ "Win32->splitpath('d1/d2\\d3/',1)",                    ',d1/d2\\d3/,'                      ],
195 [ "Win32->splitpath('\\\\node\\share\\d1/d2\\d3/',1)",   '\\\\node\\share,\\d1/d2\\d3/,'     ],
196
197 [ "Win32->catpath('','','file')",                            'file'                            ],
198 [ "Win32->catpath('','\\d1/d2\\d3/','')",                    '\\d1/d2\\d3/'                    ],
199 [ "Win32->catpath('','d1/d2\\d3/','')",                      'd1/d2\\d3/'                      ],
200 [ "Win32->catpath('','\\d1/d2\\d3/.','')",                   '\\d1/d2\\d3/.'                   ],
201 [ "Win32->catpath('','\\d1/d2\\d3/..','')",                  '\\d1/d2\\d3/..'                  ],
202 [ "Win32->catpath('','\\d1/d2\\d3/','.file')",               '\\d1/d2\\d3/.file'               ],
203 [ "Win32->catpath('','\\d1/d2\\d3/','file')",                '\\d1/d2\\d3/file'                ],
204 [ "Win32->catpath('','d1/d2\\d3/','file')",                  'd1/d2\\d3/file'                  ],
205 [ "Win32->catpath('C:','\\d1/d2\\d3/','')",                  'C:\\d1/d2\\d3/'                  ],
206 [ "Win32->catpath('C:','d1/d2\\d3/','')",                    'C:d1/d2\\d3/'                    ],
207 [ "Win32->catpath('C:','\\d1/d2\\d3/','file')",              'C:\\d1/d2\\d3/file'              ],
208 [ "Win32->catpath('C:','d1/d2\\d3/','file')",                'C:d1/d2\\d3/file'                ],
209 [ "Win32->catpath('C:','\\../d2\\d3/','file')",              'C:\\../d2\\d3/file'              ],
210 [ "Win32->catpath('C:','../d2\\d3/','file')",                'C:../d2\\d3/file'                ],
211 [ "Win32->catpath('','\\../..\\d1/','')",                    '\\../..\\d1/'                    ],
212 [ "Win32->catpath('','\\./.\\d1/','')",                      '\\./.\\d1/'                      ],
213 [ "Win32->catpath('\\\\node\\share','\\d1/d2\\d3/','')",     '\\\\node\\share\\d1/d2\\d3/'     ],
214 [ "Win32->catpath('\\\\node\\share','\\d1/d2\\d3/','file')", '\\\\node\\share\\d1/d2\\d3/file' ],
215 [ "Win32->catpath('\\\\node\\share','\\d1/d2\\','file')",    '\\\\node\\share\\d1/d2\\file'    ],
216
217 [ "Win32->splitdir('')",             ''           ],
218 [ "Win32->splitdir('\\d1/d2\\d3/')", ',d1,d2,d3,' ],
219 [ "Win32->splitdir('d1/d2\\d3/')",   'd1,d2,d3,'  ],
220 [ "Win32->splitdir('\\d1/d2\\d3')",  ',d1,d2,d3'  ],
221 [ "Win32->splitdir('d1/d2\\d3')",    'd1,d2,d3'   ],
222
223 [ "Win32->catdir()",                        ''                   ],
224 [ "Win32->catdir('')",                      '\\'                 ],
225 [ "Win32->catdir('/')",                     '\\'                 ],
226 [ "Win32->catdir('/', '../')",              '\\'                 ],
227 [ "Win32->catdir('/', '..\\')",             '\\'                 ],
228 [ "Win32->catdir('\\', '../')",             '\\'                 ],
229 [ "Win32->catdir('\\', '..\\')",            '\\'                 ],
230 [ "Win32->catdir('//d1','d2')",             '\\\\d1\\d2'         ],
231 [ "Win32->catdir('\\d1\\','d2')",           '\\d1\\d2'         ],
232 [ "Win32->catdir('\\d1','d2')",             '\\d1\\d2'         ],
233 [ "Win32->catdir('\\d1','\\d2')",           '\\d1\\d2'         ],
234 [ "Win32->catdir('\\d1','\\d2\\')",         '\\d1\\d2'         ],
235 [ "Win32->catdir('','/d1','d2')",           '\\d1\\d2'         ],
236 [ "Win32->catdir('','','/d1','d2')",        '\\d1\\d2'         ],
237 [ "Win32->catdir('','//d1','d2')",          '\\d1\\d2'         ],
238 [ "Win32->catdir('','','//d1','d2')",       '\\d1\\d2'         ],
239 [ "Win32->catdir('','d1','','d2','')",      '\\d1\\d2'           ],
240 [ "Win32->catdir('','d1','d2','d3','')",    '\\d1\\d2\\d3'       ],
241 [ "Win32->catdir('d1','d2','d3','')",       'd1\\d2\\d3'         ],
242 [ "Win32->catdir('','d1','d2','d3')",       '\\d1\\d2\\d3'       ],
243 [ "Win32->catdir('d1','d2','d3')",          'd1\\d2\\d3'         ],
244 [ "Win32->catdir('A:/d1','d2','d3')",       'A:\\d1\\d2\\d3'     ],
245 [ "Win32->catdir('A:/d1','d2','d3','')",    'A:\\d1\\d2\\d3'     ],
246 #[ "Win32->catdir('A:/d1','B:/d2','d3','')", 'A:\\d1\\d2\\d3'     ],
247 [ "Win32->catdir('A:/d1','B:/d2','d3','')", 'A:\\d1\\B:\\d2\\d3' ],
248 [ "Win32->catdir('A:/')",                   'A:\\'               ],
249 [ "Win32->catdir('\\', 'foo')",             '\\foo'              ],
250 [ "Win32->catdir('','','..')",              '\\'                 ],
251 [ "Win32->catdir('A:', 'foo')",             'A:\\foo'            ],
252
253 [ "Win32->catfile('a','b','c')",        'a\\b\\c' ],
254 [ "Win32->catfile('a','b','.\\c')",      'a\\b\\c'  ],
255 [ "Win32->catfile('.\\a','b','c')",      'a\\b\\c'  ],
256 [ "Win32->catfile('c')",                'c' ],
257 [ "Win32->catfile('.\\c')",              'c' ],
258 [ "Win32->catfile('a/..','../b')",       '..\\b' ],
259 [ "Win32->catfile('A:', 'foo')",         'A:\\foo'            ],
260
261
262 [ "Win32->canonpath('')",               ''                    ],
263 [ "Win32->canonpath('a:')",             'A:'                  ],
264 [ "Win32->canonpath('A:f')",            'A:f'                 ],
265 [ "Win32->canonpath('A:/')",            'A:\\'                ],
266 # rt.perl.org 27052
267 [ "Win32->canonpath('a\\..\\..\\b\\c')", '..\\b\\c'           ],
268 [ "Win32->canonpath('//a\\b//c')",      '\\\\a\\b\\c'         ],
269 [ "Win32->canonpath('/a/..../c')",      '\\a\\....\\c'        ],
270 [ "Win32->canonpath('//a/b\\c')",       '\\\\a\\b\\c'         ],
271 [ "Win32->canonpath('////')",           '\\'                  ],
272 [ "Win32->canonpath('//')",             '\\'                  ],
273 [ "Win32->canonpath('/.')",             '\\'                  ],
274 [ "Win32->canonpath('//a/b/../../c')",  '\\\\a\\b\\c'         ],
275 [ "Win32->canonpath('//a/b/c/../d')",   '\\\\a\\b\\d'         ],
276 [ "Win32->canonpath('//a/b/c/../../d')",'\\\\a\\b\\d'         ],
277 [ "Win32->canonpath('//a/b/c/.../d')",  '\\\\a\\b\\d'         ],
278 [ "Win32->canonpath('/a/b/c/../../d')", '\\a\\d'              ],
279 [ "Win32->canonpath('/a/b/c/.../d')",   '\\a\\d'              ],
280 [ "Win32->canonpath('\\../temp\\')",    '\\temp'              ],
281 [ "Win32->canonpath('\\../')",          '\\'                  ],
282 [ "Win32->canonpath('\\..\\')",         '\\'                  ],
283 [ "Win32->canonpath('/../')",           '\\'                  ],
284 [ "Win32->canonpath('/..\\')",          '\\'                  ],
285 [ "Win32->canonpath('d1/../foo')",      'foo'                 ],
286
287 # FakeWin32 subclass (see below) just sets CWD to C:\one\two and getdcwd('D') to D:\alpha\beta
288
289 [ "FakeWin32->abs2rel('/t1/t2/t3','/t1/t2/t3')",     '.'                      ],
290 [ "FakeWin32->abs2rel('/t1/t2/t4','/t1/t2/t3')",     '..\\t4'                 ],
291 [ "FakeWin32->abs2rel('/t1/t2','/t1/t2/t3')",        '..'                     ],
292 [ "FakeWin32->abs2rel('/t1/t2/t3/t4','/t1/t2/t3')",  't4'                     ],
293 [ "FakeWin32->abs2rel('/t4/t5/t6','/t1/t2/t3')",     '..\\..\\..\\t4\\t5\\t6' ],
294 [ "FakeWin32->abs2rel('../t4','/t1/t2/t3')",         '..\\..\\..\\one\\t4'    ],  # Uses _cwd()
295 [ "FakeWin32->abs2rel('/','/t1/t2/t3')",             '..\\..\\..'             ],
296 [ "FakeWin32->abs2rel('///','/t1/t2/t3')",           '..\\..\\..'             ],
297 [ "FakeWin32->abs2rel('/.','/t1/t2/t3')",            '..\\..\\..'             ],
298 [ "FakeWin32->abs2rel('/./','/t1/t2/t3')",           '..\\..\\..'             ],
299 [ "FakeWin32->abs2rel('\\\\a/t1/t2/t4','/t2/t3')",   '\\\\a\\t1\\t2\\t4'      ],
300 [ "FakeWin32->abs2rel('//a/t1/t2/t4','/t2/t3')",     '\\\\a\\t1\\t2\\t4'      ],
301 [ "FakeWin32->abs2rel('A:/t1/t2/t3','A:/t1/t2/t3')",     '.'                  ],
302 [ "FakeWin32->abs2rel('A:/t1/t2/t3/t4','A:/t1/t2/t3')",  't4'                 ],
303 [ "FakeWin32->abs2rel('A:/t1/t2/t3','A:/t1/t2/t3/t4')",  '..'                 ],
304 [ "FakeWin32->abs2rel('A:/t1/t2/t3','B:/t1/t2/t3')",     'A:\\t1\\t2\\t3'     ],
305 [ "FakeWin32->abs2rel('A:/t1/t2/t3/t4','B:/t1/t2/t3')",  'A:\\t1\\t2\\t3\\t4' ],
306 [ "FakeWin32->abs2rel('E:/foo/bar/baz')",            'E:\\foo\\bar\\baz'      ],
307 [ "FakeWin32->abs2rel('C:/one/two/three')",          'three'                  ],
308 [ "FakeWin32->abs2rel('C:\\Windows\\System32', 'C:\\')",  'Windows\System32'  ],
309 [ "FakeWin32->abs2rel('\\\\computer2\\share3\\foo.txt', '\\\\computer2\\share3')",  'foo.txt' ],
310 [ "FakeWin32->abs2rel('C:\\one\\two\\t\\asd1\\', 't\\asd\\')", '..\\asd1'     ],
311 [ "FakeWin32->abs2rel('\\one\\two', 'A:\\foo')",     'C:\\one\\two'           ],
312
313 [ "FakeWin32->rel2abs('temp','C:/')",                       'C:\\temp'                        ],
314 [ "FakeWin32->rel2abs('temp','C:/a')",                      'C:\\a\\temp'                     ],
315 [ "FakeWin32->rel2abs('temp','C:/a/')",                     'C:\\a\\temp'                     ],
316 [ "FakeWin32->rel2abs('../','C:/')",                        'C:\\'                            ],
317 [ "FakeWin32->rel2abs('../','C:/a')",                       'C:\\'                            ],
318 [ "FakeWin32->rel2abs('\\foo','C:/a')",                     'C:\\foo'                         ],
319 [ "FakeWin32->rel2abs('temp','//prague_main/work/')",       '\\\\prague_main\\work\\temp'     ],
320 [ "FakeWin32->rel2abs('../temp','//prague_main/work/')",    '\\\\prague_main\\work\\temp'     ],
321 [ "FakeWin32->rel2abs('temp','//prague_main/work')",        '\\\\prague_main\\work\\temp'     ],
322 [ "FakeWin32->rel2abs('../','//prague_main/work')",         '\\\\prague_main\\work'           ],
323 [ "FakeWin32->rel2abs('D:foo.txt')",                        'D:\\alpha\\beta\\foo.txt'        ],
324
325 [ "VMS->case_tolerant()",         '1'  ],
326
327 [ "VMS->catfile('a','b','c')",    $vms_unix_rpt ? 'a/b/c' : '[.a.b]c'  ],
328 [ "VMS->catfile('a','b','[]c')",  $vms_unix_rpt ? 'a/b/c' : '[.a.b]c'  ],
329 [ "VMS->catfile('[.a]','b','c')", $vms_unix_rpt ? 'a/b/c' : '[.a.b]c'  ],
330 [ "VMS->catfile('a/b/','c')",     $vms_unix_rpt ? 'a/b/c' : '[.a.b]c'  ],
331 [ "VMS->catfile('c')",                 'c' ],
332 [ "VMS->catfile('[]c')",               'c' ],
333
334 [ "VMS->catfile('0','b','c')", $vms_unix_rpt ? '0/b/c' : '[.0.b]c' ],
335 [ "VMS->catfile('a','0','c')", $vms_unix_rpt ? 'a/0/c' : '[.a.0]c' ],
336 [ "VMS->catfile('a','b','0')", $vms_unix_rpt ? 'a/b/0' : '[.a.b]0' ],
337 [ "VMS->catfile('0','0','c')", $vms_unix_rpt ? '0/0/c' : '[.0.0]c' ],
338 [ "VMS->catfile('a','0','0')", $vms_unix_rpt ? 'a/0/0' : '[.a.0]0' ],
339 [ "VMS->catfile('0','b','0')", $vms_unix_rpt ? '0/b/0' : '[.0.b]0' ],
340 [ "VMS->catfile('0','0','0')", $vms_unix_rpt ? '0/0/0' : '[.0.0]0' ],
341
342
343 [ "VMS->splitpath('file')",                                       ',,file'                                   ],
344 [ "VMS->splitpath('[d1.d2.d3]')",                                 ',[d1.d2.d3],'                               ],
345 [ "VMS->splitpath('[.d1.d2.d3]')",                                ',[.d1.d2.d3],'                              ],
346 [ "VMS->splitpath('[d1.d2.d3]file')",                             ',[d1.d2.d3],file'                           ],
347 [ "VMS->splitpath('d1/d2/d3/file')",
348        $vms_unix_rpt ? ',d1/d2/d3/,file' : ',[.d1.d2.d3],file' ],
349 [ "VMS->splitpath('/d1/d2/d3/file')",
350        $vms_unix_rpt ? ',/d1/d2/d3/,file' : 'd1:,[d2.d3],file' ],
351 [ "VMS->splitpath('[.d1.d2.d3]file')",                            ',[.d1.d2.d3],file'                          ],
352 [ "VMS->splitpath('node::volume:[d1.d2.d3]')",                    'node::volume:,[d1.d2.d3],'                  ],
353 [ "VMS->splitpath('node::volume:[d1.d2.d3]file')",                'node::volume:,[d1.d2.d3],file'              ],
354 [ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]')",     'node"access_spec"::volume:,[d1.d2.d3],'     ],
355 [ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]file')", 'node"access_spec"::volume:,[d1.d2.d3],file' ],
356
357 [ "VMS->splitpath('[]')",                                         ',[],'                                       ],
358 [ "VMS->splitpath('[-]')",                                        ',[-],'                                      ],
359 [ "VMS->splitpath('[]file')",                                     ',[],file'                                   ],
360 [ "VMS->splitpath('[-]file')",                                    ',[-],file'                                  ],
361 [ "VMS->splitpath('')",                                           ',,'                                         ],
362 [ "VMS->splitpath('0')",                                          ',,0'                                        ],
363 [ "VMS->splitpath('[0]')",                                        ',[0],'                                      ],
364 [ "VMS->splitpath('[.0]')",                                       ',[.0],'                                     ],
365 [ "VMS->splitpath('[0.0.0]')",                                    ',[0.0.0],'                                  ],
366 [ "VMS->splitpath('[.0.0.0]')",                                   ',[.0.0.0],'                                 ],
367 [ "VMS->splitpath('[0]0')",                                       ',[0],0'                                     ],
368 [ "VMS->splitpath('[0.0.0]0')",                                   ',[0.0.0],0'                                 ],
369 [ "VMS->splitpath('[.0.0.0]0')",                                  ',[.0.0.0],0'                                ],
370 [ "VMS->splitpath('0/0')",    $vms_unix_rpt ? ',0/,0' : ',[.0],0'  ],
371 [ "VMS->splitpath('0/0/0')",  $vms_unix_rpt ? ',0/0/,0' : ',[.0.0],0'  ],
372 [ "VMS->splitpath('/0/0')",   $vms_unix_rpt ? ',/0/,0' : '0:,[000000],0'  ],
373 [ "VMS->splitpath('/0/0/0')", $vms_unix_rpt ? ',/0/0/,0' : '0:,[0],0'  ],
374 [ "VMS->splitpath('d1',1)",                                       ',d1,'                                       ],
375 # $no_file tests
376 [ "VMS->splitpath('[d1.d2.d3]',1)",                               ',[d1.d2.d3],'                               ],
377 [ "VMS->splitpath('[.d1.d2.d3]',1)",                              ',[.d1.d2.d3],'                              ],
378 [ "VMS->splitpath('d1/d2/d3',1)",  $vms_unix_rpt ? ',d1/d2/d3,' : ',[.d1.d2.d3],' ],
379 [ "VMS->splitpath('/d1/d2/d3',1)", $vms_unix_rpt ? ',/d1/d2/d3,' : 'd1:,[d2.d3],' ],
380 [ "VMS->splitpath('node::volume:[d1.d2.d3]',1)",                  'node::volume:,[d1.d2.d3],'                  ],
381 [ "VMS->splitpath('node\"access_spec\"::volume:[d1.d2.d3]',1)",   'node"access_spec"::volume:,[d1.d2.d3],'     ],
382 [ "VMS->splitpath('[]',1)",                                       ',[],'                                       ],
383 [ "VMS->splitpath('[-]',1)",                                      ',[-],'                                      ],
384 [ "VMS->splitpath('',1)",                                         ',,'                                         ],
385 [ "VMS->splitpath('0',1)",                                        ',0,'                                        ],
386 [ "VMS->splitpath('[0]',1)",                                      ',[0],'                                      ],
387 [ "VMS->splitpath('[.0]',1)",                                     ',[.0],'                                     ],
388 [ "VMS->splitpath('[0.0.0]',1)",                                  ',[0.0.0],'                                  ],
389 [ "VMS->splitpath('[.0.0.0]',1)",                                 ',[.0.0.0],'                                 ],
390 [ "VMS->splitpath('0/0',1)",    $vms_unix_rpt ? ',0/0,' : ',[.0.0],' ],
391 [ "VMS->splitpath('0/0/0',1)",  $vms_unix_rpt ? ',0/0/0,' : ',[.0.0.0],' ],
392 [ "VMS->splitpath('/0/0',1)",   $vms_unix_rpt ? ',/0/0,' : '0:,[000000.0],' ],
393 [ "VMS->splitpath('/0/0/0',1)", $vms_unix_rpt ? ',/0/0/0,' : '0:,[0.0],' ],
394
395 [ "VMS->catpath('','','file')",                                       'file'                                     ],
396 [ "VMS->catpath('','[d1.d2.d3]','')",                                 '[d1.d2.d3]'                               ],
397 [ "VMS->catpath('','[.d1.d2.d3]','')",                                '[.d1.d2.d3]'                              ],
398 [ "VMS->catpath('','[d1.d2.d3]','file')",                             '[d1.d2.d3]file'                           ],
399 [ "VMS->catpath('','[.d1.d2.d3]','file')",                            '[.d1.d2.d3]file'                          ],
400 [ "VMS->catpath('','d1/d2/d3','file')",
401                              $vms_unix_rpt ? 'd1/d2/d3/file' : '[.d1.d2.d3]file' ],
402 [ "VMS->catpath('v','d1/d2/d3','file')",                              'v:[.d1.d2.d3]file' ],
403 [ "VMS->catpath('v','','file')",                                      'v:file' ],
404 [ "VMS->catpath('v','w:[d1.d2.d3]','file')",                          'v:[d1.d2.d3]file'                         ],
405 [ "VMS->catpath('node::volume:','[d1.d2.d3]','')",                    'node::volume:[d1.d2.d3]'                  ],
406 [ "VMS->catpath('node::volume:','[d1.d2.d3]','file')",                'node::volume:[d1.d2.d3]file'              ],
407 [ "VMS->catpath('node\"access_spec\"::volume:','[d1.d2.d3]','')",     'node"access_spec"::volume:[d1.d2.d3]'     ],
408 [ "VMS->catpath('node\"access_spec\"::volume:','[d1.d2.d3]','file')", 'node"access_spec"::volume:[d1.d2.d3]file' ],
409
410 [ "VMS->canonpath('')",                                 ''                        ],
411 [ "VMS->canonpath('volume:[d1]file')",                  $vms_unix_rpt ? '/volume/d1/file'               : 'volume:[d1]file'                ],
412 [ "VMS->canonpath('volume:[d1.-.d2.][d3.d4.-]')",       $vms_unix_rpt ? '/volume/d2/d3/'               : 'volume:[d2.d3]'                  ],
413 [ "VMS->canonpath('volume:[000000.d1]d2.dir;1')",       $vms_unix_rpt ? '/volume/d1/d2.dir.1'          : 'volume:[d1]d2.dir;1'             ],
414 [ "VMS->canonpath('volume:[d1.d2.d3]file.txt')",        $vms_unix_rpt ? '/volume/d1/d2/d3/file.txt'    : 'volume:[d1.d2.d3]file.txt'       ],
415 [ "VMS->canonpath('[d1.d2.d3]file.txt')",               $vms_unix_rpt ? '/sys$disk/d1/d2/d3/file.txt'  : '[d1.d2.d3]file.txt'              ],
416 [ "VMS->canonpath('volume:[-.d1.d2.d3]file.txt')",      $vms_unix_rpt ? '/volume/../d1/d2/d3/file.txt' : 'volume:[-.d1.d2.d3]file.txt'     ],
417 [ "VMS->canonpath('[-.d1.d2.d3]file.txt')",             $vms_unix_rpt ? '../d1/d2/d3/file.txt'         : '[-.d1.d2.d3]file.txt'            ],
418 [ "VMS->canonpath('volume:[--.d1.d2.d3]file.txt')",     $vms_unix_rpt ? '/volume/../../d1/d2/d3/file.txt' : 'volume:[--.d1.d2.d3]file.txt' ],
419 [ "VMS->canonpath('[--.d1.d2.d3]file.txt')",            $vms_unix_rpt ? '../../d1/d2/d3/file.txt'      : '[--.d1.d2.d3]file.txt'           ],
420 [ "VMS->canonpath('volume:[d1.-.d2.d3]file.txt')",      $vms_unix_rpt ? '/volume/d2/d3/file.txt'       : 'volume:[d2.d3]file.txt'          ],
421 [ "VMS->canonpath('[d1.-.d2.d3]file.txt')",             $vms_unix_rpt ? '/sys$disk/d2/d3/file.txt'     : '[d2.d3]file.txt'                 ],
422 [ "VMS->canonpath('volume:[d1.--.d2.d3]file.txt')",     $vms_unix_rpt ? '/volume/../d2/d3/file.txt'    : 'volume:[-.d2.d3]file.txt'        ],
423 [ "VMS->canonpath('[d1.--.d2.d3]file.txt')",            $vms_unix_rpt ? '../d2/d3/file.txt'            : '[-.d2.d3]file.txt'               ],
424 [ "VMS->canonpath('volume:[d1.d2.-.d3]file.txt')",      $vms_unix_rpt ? '/volume/d1/d3/file.txt'       : 'volume:[d1.d3]file.txt'          ],
425 [ "VMS->canonpath('[d1.d2.-.d3]file.txt')",             $vms_unix_rpt ? '/sys$disk/d1/d3/file.txt'     : '[d1.d3]file.txt'                 ],
426 [ "VMS->canonpath('volume:[d1.d2.--.d3]file.txt')",     $vms_unix_rpt ? '/volume/d3/file.txt'          : 'volume:[d3]file.txt'             ],
427 [ "VMS->canonpath('[d1.d2.--.d3]file.txt')",            $vms_unix_rpt ? '/sys$disk/d3/file.txt'        : '[d3]file.txt'                    ],
428 [ "VMS->canonpath('volume:[d1.d2.d3.-]file.txt')",      $vms_unix_rpt ? '/volume/d1/d2/file.txt'       : 'volume:[d1.d2]file.txt'          ],
429 [ "VMS->canonpath('[d1.d2.d3.-]file.txt')",             $vms_unix_rpt ? '/sys$disk/d1/d2/file.txt'     : '[d1.d2]file.txt'                 ],
430 [ "VMS->canonpath('volume:[d1.d2.d3.--]file.txt')",     $vms_unix_rpt ? '/volume/d1/file.txt'          : 'volume:[d1]file.txt'             ],
431 [ "VMS->canonpath('[d1.d2.d3.--]file.txt')",            $vms_unix_rpt ? '/sys$disk/d1/file.txt'        : '[d1]file.txt'                    ],
432 [ "VMS->canonpath('volume:[d1.000000.][000000.][d3.--]file.txt')", $vms_unix_rpt ? '/volume/d1/file.txt'
433                                                                                  : 'volume:[d1]file.txt'                                   ],
434 [ "VMS->canonpath('[d1.000000.][000000.][d3.--]file.txt')",             $vms_unix_rpt ? '/sys$disk/d1/file.txt'
435                                                                                       : '[d1]file.txt'                                     ],
436 [ "VMS->canonpath('volume:[d1.000000.][000000.][d2.000000]file.txt')",  $vms_unix_rpt ? '/volume/d1/000000/d2/000000/file.txt'
437                                                                                       : 'volume:[d1.000000.d2.000000]file.txt'             ],
438 [ "VMS->canonpath('[d1.000000.][000000.][d2.000000]file.txt')",         $vms_unix_rpt ? '/sys$disk/d1/000000/d2/000000/file.txt'
439                                                                                       : '[d1.000000.d2.000000]file.txt'                    ],
440 [ "VMS->canonpath('volume:[d1.000000.][000000.][d3.--.000000]file.txt')", $vms_unix_rpt ? '/volume/d1/000000/file.txt'
441                                                                                         : 'volume:[d1.000000]file.txt'                     ],
442 [ "VMS->canonpath('[d1.000000.][000000.][d3.--.000000]file.txt')",      $vms_unix_rpt ? '/sys$disk/d1/000000/file.txt'
443                                                                                       : '[d1.000000]file.txt'                              ],
444 [ "VMS->canonpath('volume:[d1.000000.][000000.][-.-.000000]file.txt')", $vms_unix_rpt ? '/volume/file.txt'
445                                                                                       : 'volume:[000000]file.txt'                          ],
446 [ "VMS->canonpath('[d1.000000.][000000.][--.-.000000]file.txt')",       $vms_unix_rpt ? '../file.txt'  : '[-.000000]file.txt'              ],
447 [ "VMS->canonpath('[d1.d2.--]file')",                                   $vms_unix_rpt ? '../file.txt'  : '[000000]file'                    ],
448 # During the Perl 5.8 era, FS::Unix stopped eliminating redundant path elements, so mimic that here.
449 [ "VMS->canonpath('a/../../b/c.dat')",                  $vms_unix_rpt ? 'a/../../b/c.dat'              : '[-.b]c.dat'                      ],
450 [ "VMS->canonpath('^<test^.new.-.caret^ escapes^>')",   $vms_unix_rpt ? '/<test.new.-.caret escapes>' : '^<test^.new.-.caret^ escapes^>'                                                   ],
451 # Check that directory specs with caret-dot component is treated correctly
452 [ "VMS->canonpath('foo:[bar.coo.kie.--]file.txt')",     $vms_unix_rpt ? '/foo/bar/file.txt'            : "foo:[bar]file.txt" ],
453 [ "VMS->canonpath('foo:[bar^.coo.kie.--]file.txt')",    $vms_unix_rpt ? '/foo/file.txt'                : "foo:[000000]file.txt" ],
454 [ "VMS->canonpath('foo:[bar.coo^.kie.--]file.txt')",    $vms_unix_rpt ? '/foo/file.txt'                : "foo:[000000]file.txt" ],
455 [ "VMS->canonpath('foo:[bar.coo.kie.-]file.txt')",      $vms_unix_rpt ? '/foo/bar/coo/file.txt'        : "foo:[bar.coo]file.txt" ],
456 [ "VMS->canonpath('foo:[bar^.coo.kie.-]file.txt')",     $vms_unix_rpt ? '/foo/bar.coo/file.txt'        : "foo:[bar^.coo]file.txt" ],
457 [ "VMS->canonpath('foo:[bar.coo^.kie.-]file.txt')",     $vms_unix_rpt ? '/foo/bar/file.txt'            : "foo:[bar]file.txt" ],
458
459 [ "VMS->splitdir('')",            ''          ],
460 [ "VMS->splitdir('[]')",          ''          ],
461 [ "VMS->splitdir('d1.d2.d3')",    'd1,d2,d3'  ],
462 [ "VMS->splitdir('[d1.d2.d3]')",  'd1,d2,d3'  ],
463 [ "VMS->splitdir('.d1.d2.d3')",   'd1,d2,d3' ],
464 [ "VMS->splitdir('[.d1.d2.d3]')", 'd1,d2,d3' ],
465 [ "VMS->splitdir('.-.d2.d3')",    '-,d2,d3'  ],
466 [ "VMS->splitdir('[.-.d2.d3]')",  '-,d2,d3'  ],
467 [ "VMS->splitdir('[d1.d2]')",           'd1,d2'  ],
468 [ "VMS->splitdir('[d1-.--d2]')",        'd1-,--d2'  ],
469 [ "VMS->splitdir('[d1---.-.d2]')",      'd1---,-,d2'  ],
470 [ "VMS->splitdir('[d1.---.d2]')",       'd1,-,-,-,d2'  ],
471 [ "VMS->splitdir('[d1---d2]')",         'd1---d2'  ],
472 [ "VMS->splitdir('[d1.][000000.d2]')",  'd1,d2'  ],
473 [ "VMS->splitdir('[.d1.d2^.d3]')", 'd1,d2^.d3' ],
474
475 [ "VMS->catdir('')",                            ''                 ],
476 [ "VMS->catdir('foo')",            $vms_unix_rpt ? 'foo'      : '[.foo]'      ],
477 [ "VMS->catdir('d1','d2','d3')",   $vms_unix_rpt ? 'd1/d2/d3' : '[.d1.d2.d3]' ],
478 [ "VMS->catdir('d1','d2/','d3')",  $vms_unix_rpt ? 'd1/d2/d3' : '[.d1.d2.d3]' ],
479 [ "VMS->catdir('','d1','d2','d3')",$vms_unix_rpt ? '/d1/d2/d3' : '[.d1.d2.d3]' ],
480 [ "VMS->catdir('','-','d2','d3')", $vms_unix_rpt ? '-/d2/d3'   : '[-.d2.d3]' ],
481 [ "VMS->catdir('','-','','d3')",   $vms_unix_rpt ? '-/d3'      : '[-.d3]' ],
482 [ "VMS->catdir('dir.dir','d2.dir','d3.dir')", $vms_unix_rpt ? 'dir/d2/d3'
483                                                             : '[.dir.d2.d3]' ],
484 [ "VMS->catdir('[.name]')",             $vms_unix_rpt ? 'name/'     : '[.name]' ],
485 [ "VMS->catdir('[.name]','[.name]')",   $vms_unix_rpt ? 'name/name' :'[.name.name]' ],
486 [ "VMS->catdir('/a/b/c','[-]')",        $vms_unix_rpt ? '/a/b/c/..' : 'a:[b]'],
487 [ "VMS->catdir('a:[b.c]','..')",        $vms_unix_rpt ? '/a/b/c/..' : 'a:[b]'],
488
489 [ "VMS->abs2rel('node::volume:[t1.t2.t3]','node::volume:[t1.t2.t3]')", $vms_unix_rpt ? './' : '[]' ],
490 [ "VMS->abs2rel('node::volume:[t1.t2.t3]','[t1.t2.t3]')", $vms_unix_rpt ? '/node//volume/t1/t2/t3/' : 'node::volume:[t1.t2.t3]' ],
491 [ "VMS->abs2rel('node::volume:[t1.t2.t4]','node::volume:[t1.t2.t3]')", $vms_unix_rpt ? '../t4/' : '[-.t4]' ],
492 [ "VMS->abs2rel('node::volume:[t1.t2.t4]','[t1.t2.t3]')", $vms_unix_rpt ? '/node//volume/t1/t2/t4/' : 'node::volume:[t1.t2.t4]' ],
493 [ "VMS->abs2rel('/volume/t1/t2/t3','/volume/t1')",        $vms_unix_rpt ? 't2/t3' : '[.t2]t3' ],
494 [ "VMS->abs2rel('/volume/t1/t2/t3/t4','/volume/t1/xyz')", $vms_unix_rpt ? '../t2/t3/t4' : '[-.t2.t3]t4' ],
495 [ "VMS->abs2rel('[t1.t2.t3]','[t1.t2.t3]')",              $vms_unix_rpt ? './' : '[]'             ],
496 [ "VMS->abs2rel('[t1.t2.t3]file','[t1.t2.t3]')",          'file'                                  ],
497 [ "VMS->abs2rel('[t1.t2.t3]file','[t1.t2]')",             $vms_unix_rpt ? 't3/file' : '[.t3]file' ],
498 [ "VMS->abs2rel('v:[t1.t2.t3]file','v:[t1.t2]')",         $vms_unix_rpt ? 't3/file' : '[.t3]file' ],
499 [ "VMS->abs2rel('[t1.t2.t4]','[t1.t2.t3]')",              $vms_unix_rpt ? '../t4/'  : '[-.t4]'    ],
500 [ "VMS->abs2rel('[t1.t2]file','[t1.t2.t3]')",             $vms_unix_rpt ? '../file' : '[-]file'   ],
501 [ "VMS->abs2rel('[t1.t2.t3.t4]','[t1.t2.t3]')",           $vms_unix_rpt ? 't4/'     : '[.t4]'     ],
502 [ "VMS->abs2rel('[t4.t5.t6]','[t1.t2.t3]')",              $vms_unix_rpt ? '../../../t4/t5/t6/' : '[---.t4.t5.t6]'   ],
503 [ "VMS->abs2rel('[000000]','[t1.t2.t3]')",                $vms_unix_rpt ? '../../../'          : '[---]'            ],
504 [ "VMS->abs2rel('a:[t1.t2.t4]','a:[t1.t2.t3]')",          $vms_unix_rpt ? '../t4/'             : '[-.t4]'           ],
505 [ "VMS->abs2rel('a:[t1.t2.t4]','[t1.t2.t3]')",            $vms_unix_rpt ? '/a/t1/t2/t4'        : 'a:[t1.t2.t4]'    ],
506 [ "VMS->abs2rel('[a.-.b.c.-]','[t1.t2.t3]')",             $vms_unix_rpt ? '../../../b/'         : '[---.b]'         ],
507
508 [ "VMS->rel2abs('[.t4]','[t1.t2.t3]')",          $vms_unix_rpt ? '/sys$disk/t1/t2/t3/t4/'    : '[t1.t2.t3.t4]'    ],
509 [ "VMS->rel2abs('[.t4.t5]','[t1.t2.t3]')",       $vms_unix_rpt ? '/sys$disk/t1/t2/t3/t4/t5/' : '[t1.t2.t3.t4.t5]' ],
510 [ "VMS->rel2abs('[]','[t1.t2.t3]')",             $vms_unix_rpt ? '/sys$disk/t1/t2/t3/'       : '[t1.t2.t3]'       ],
511 [ "VMS->rel2abs('[-]','[t1.t2.t3]')",            $vms_unix_rpt ? '/sys$disk/t1/t2/'          : '[t1.t2]'          ],
512 [ "VMS->rel2abs('[-.t4]','[t1.t2.t3]')",         $vms_unix_rpt ? '/sys$disk/t1/t2/t4/'       : '[t1.t2.t4]'       ],
513 [ "VMS->rel2abs('[t1]','[t1.t2.t3]')",           $vms_unix_rpt ? '/sys$disk/t1/'             : '[t1]'             ],
514
515 [ "VMS->file_name_is_absolute('foo:')",                '1'  ],
516 [ "VMS->file_name_is_absolute('foo:bar.dat')",         '1'  ],
517 [ "VMS->file_name_is_absolute('foo:[000000]bar.dat')", '1'  ],
518
519 [ "OS2->case_tolerant()",         '1'  ],
520
521 [ "OS2->catdir('A:/d1','B:/d2','d3','')", 'A:/d1/B:/d2/d3' ],
522
523 [ "OS2->catfile('a','b','c')",            'a/b/c'          ],
524 [ "OS2->catfile('a','b','./c')",          'a/b/c'  ],
525 [ "OS2->catfile('./a','b','c')",          'a/b/c'  ],
526 [ "OS2->catfile('c')",                    'c' ],
527 [ "OS2->catfile('./c')",                  'c' ],
528
529 [ "OS2->catdir('/', '../')",              '/'                 ],
530 [ "OS2->catdir('/', '..\\')",             '/'                 ],
531 [ "OS2->catdir('\\', '../')",             '/'                 ],
532 [ "OS2->catdir('\\', '..\\')",            '/'                 ],
533
534 [ "Mac->case_tolerant()",         '1'  ],
535
536 [ "Mac->catpath('','','')",              ''                ],
537 [ "Mac->catpath('',':','')",             ':'               ],
538 [ "Mac->catpath('','::','')",            '::'              ],
539
540 [ "Mac->catpath('hd','','')",            'hd:'             ],
541 [ "Mac->catpath('hd:','','')",           'hd:'             ],
542 [ "Mac->catpath('hd:',':','')",          'hd:'             ],
543 [ "Mac->catpath('hd:','::','')",         'hd::'            ],
544
545 [ "Mac->catpath('hd','','file')",       'hd:file'          ],
546 [ "Mac->catpath('hd',':','file')",      'hd:file'          ],
547 [ "Mac->catpath('hd','::','file')",     'hd::file'         ],
548 [ "Mac->catpath('hd',':::','file')",    'hd:::file'        ],
549
550 [ "Mac->catpath('hd:','',':file')",      'hd:file'         ],
551 [ "Mac->catpath('hd:',':',':file')",     'hd:file'         ],
552 [ "Mac->catpath('hd:','::',':file')",    'hd::file'        ],
553 [ "Mac->catpath('hd:',':::',':file')",   'hd:::file'       ],
554
555 [ "Mac->catpath('hd:','d1','file')",     'hd:d1:file'      ],
556 [ "Mac->catpath('hd:',':d1:',':file')",  'hd:d1:file'      ],
557 [ "Mac->catpath('hd:','hd:d1','')",      'hd:d1:'          ],
558
559 [ "Mac->catpath('','d1','')",            ':d1:'            ],
560 [ "Mac->catpath('',':d1','')",           ':d1:'            ],
561 [ "Mac->catpath('',':d1:','')",          ':d1:'            ],
562
563 [ "Mac->catpath('','d1','file')",        ':d1:file'        ],
564 [ "Mac->catpath('',':d1:',':file')",     ':d1:file'        ],
565
566 [ "Mac->catpath('','','file')",          'file'            ],
567 [ "Mac->catpath('','',':file')",         'file'            ], # !
568 [ "Mac->catpath('',':',':file')",        ':file'           ], # !
569
570
571 [ "Mac->splitpath(':')",              ',:,'               ],
572 [ "Mac->splitpath('::')",             ',::,'              ],
573 [ "Mac->splitpath(':::')",            ',:::,'             ],
574
575 [ "Mac->splitpath('file')",           ',,file'            ],
576 [ "Mac->splitpath(':file')",          ',:,file'           ],
577
578 [ "Mac->splitpath('d1',1)",           ',:d1:,'            ], # dir, not volume
579 [ "Mac->splitpath(':d1',1)",          ',:d1:,'            ],
580 [ "Mac->splitpath(':d1:',1)",         ',:d1:,'            ],
581 [ "Mac->splitpath(':d1:')",           ',:d1:,'            ],
582 [ "Mac->splitpath(':d1:d2:d3:')",     ',:d1:d2:d3:,'      ],
583 [ "Mac->splitpath(':d1:d2:d3:',1)",   ',:d1:d2:d3:,'      ],
584 [ "Mac->splitpath(':d1:file')",       ',:d1:,file'        ],
585 [ "Mac->splitpath('::d1:file')",      ',::d1:,file'       ],
586
587 [ "Mac->splitpath('hd:', 1)",         'hd:,,'             ],
588 [ "Mac->splitpath('hd:')",            'hd:,,'             ],
589 [ "Mac->splitpath('hd:d1:d2:')",      'hd:,:d1:d2:,'      ],
590 [ "Mac->splitpath('hd:d1:d2',1)",     'hd:,:d1:d2:,'      ],
591 [ "Mac->splitpath('hd:d1:d2:file')",  'hd:,:d1:d2:,file'  ],
592 [ "Mac->splitpath('hd:d1:d2::file')", 'hd:,:d1:d2::,file' ],
593 [ "Mac->splitpath('hd::d1:d2:file')", 'hd:,::d1:d2:,file' ], # invalid path
594 [ "Mac->splitpath('hd:file')",        'hd:,,file'         ],
595
596 [ "Mac->splitdir()",                   ''            ],
597 [ "Mac->splitdir('')",                 ''            ],
598 [ "Mac->splitdir(':')",                ':'           ],
599 [ "Mac->splitdir('::')",               '::'          ],
600 [ "Mac->splitdir(':::')",              '::,::'       ],
601 [ "Mac->splitdir(':::d1:d2')",         '::,::,d1,d2' ],
602
603 [ "Mac->splitdir(':d1:d2:d3::')",      'd1,d2,d3,::'],
604 [ "Mac->splitdir(':d1:d2:d3:')",       'd1,d2,d3'   ],
605 [ "Mac->splitdir(':d1:d2:d3')",        'd1,d2,d3'   ],
606
607 # absolute paths in splitdir() work, but you'd better use splitpath()
608 [ "Mac->splitdir('hd:')",              'hd:'              ],
609 [ "Mac->splitdir('hd::')",             'hd:,::'           ], # invalid path, but it works
610 [ "Mac->splitdir('hd::d1:')",          'hd:,::,d1'        ], # invalid path, but it works
611 [ "Mac->splitdir('hd:d1:d2:::')",      'hd:,d1,d2,::,::'  ],
612 [ "Mac->splitdir('hd:d1:d2::')",       'hd:,d1,d2,::'     ],
613 [ "Mac->splitdir('hd:d1:d2:')",        'hd:,d1,d2'        ],
614 [ "Mac->splitdir('hd:d1:d2')",         'hd:,d1,d2'        ],
615 [ "Mac->splitdir('hd:d1::d2::')",      'hd:,d1,::,d2,::'  ],
616
617 [ "Mac->catdir()",                 ''             ],
618 [ "Mac->catdir(':')",              ':'            ],
619
620 [ "Mac->catdir(':', ':')",         ':'            ],
621 [ "Mac->catdir(':', '')",          ':'            ],
622
623 [ "Mac->catdir(':', '::')",        '::'           ],
624
625 [ "Mac->catdir('::', '')",         '::'           ],
626 [ "Mac->catdir('::', ':')",        '::'           ],
627
628 [ "Mac->catdir('::', '::')",       ':::'          ],
629
630 [ "Mac->catdir(':d1')",                    ':d1:'        ],
631 [ "Mac->catdir(':d1:')",                   ':d1:'        ],
632 [ "Mac->catdir(':d1','d2')",               ':d1:d2:'     ],
633 [ "Mac->catdir(':d1',':d2')",              ':d1:d2:'     ],
634 [ "Mac->catdir(':d1',':d2:')",             ':d1:d2:'     ],
635 [ "Mac->catdir(':d1',':d2::')",            ':d1:d2::'     ],
636 [ "Mac->catdir(':',':d1',':d2')",          ':d1:d2:'     ],
637 [ "Mac->catdir('::',':d1',':d2')",         '::d1:d2:'    ],
638 [ "Mac->catdir('::','::',':d1',':d2')",    ':::d1:d2:'   ],
639 [ "Mac->catdir(':',':',':d1',':d2')",      ':d1:d2:'     ],
640 [ "Mac->catdir('::',':',':d1',':d2')",     '::d1:d2:'    ],
641
642 [ "Mac->catdir('d1')",                    ':d1:'         ],
643 [ "Mac->catdir('d1','d2','d3')",          ':d1:d2:d3:'   ],
644 [ "Mac->catdir('d1','d2/','d3')",         ':d1:d2/:d3:'  ],
645 [ "Mac->catdir('d1','',':d2')",           ':d1:d2:'      ],
646 [ "Mac->catdir('d1',':',':d2')",          ':d1:d2:'      ],
647 [ "Mac->catdir('d1','::',':d2')",         ':d1::d2:'     ],
648 [ "Mac->catdir('d1',':::',':d2')",        ':d1:::d2:'    ],
649 [ "Mac->catdir('d1','::','::',':d2')",    ':d1:::d2:'    ],
650 [ "Mac->catdir('d1','d2')",               ':d1:d2:'      ],
651 [ "Mac->catdir('d1','d2', '')",           ':d1:d2:'      ],
652 [ "Mac->catdir('d1','d2', ':')",          ':d1:d2:'      ],
653 [ "Mac->catdir('d1','d2', '::')",         ':d1:d2::'     ],
654 [ "Mac->catdir('d1','d2','','')",         ':d1:d2:'      ],
655 [ "Mac->catdir('d1','d2',':','::')",      ':d1:d2::'     ],
656 [ "Mac->catdir('d1','d2','::','::')",     ':d1:d2:::'    ],
657 [ "Mac->catdir('d1',':d2')",              ':d1:d2:'      ],
658 [ "Mac->catdir('d1',':d2:')",             ':d1:d2:'      ],
659
660 [ "Mac->catdir('hd:',':d1')",       'hd:d1:'      ],
661 [ "Mac->catdir('hd:d1:',':d2')",    'hd:d1:d2:'   ],
662 [ "Mac->catdir('hd:','d1')",        'hd:d1:'      ],
663 [ "Mac->catdir('hd:d1:',':d2')",    'hd:d1:d2:'   ],
664 [ "Mac->catdir('hd:d1:',':d2:')",   'hd:d1:d2:'   ],
665
666 [ "Mac->catfile()",                      ''                      ],
667 [ "Mac->catfile('')",                    ''                      ],
668 [ "Mac->catfile(':')",                   ':'                     ],
669 [ "Mac->catfile(':', '')",               ':'                     ],
670
671 [ "Mac->catfile('d1','d2','file')",      ':d1:d2:file' ],
672 [ "Mac->catfile('d1','d2',':file')",     ':d1:d2:file' ],
673 [ "Mac->catfile('file')",                'file'        ],
674 [ "Mac->catfile(':', 'file')",           ':file'       ],
675
676 [ "Mac->canonpath('')",                   ''     ],
677 [ "Mac->canonpath(':')",                  ':'    ],
678 [ "Mac->canonpath('::')",                 '::'   ],
679 [ "Mac->canonpath('a::')",                'a::'  ],
680 [ "Mac->canonpath(':a::')",               ':a::' ],
681
682 [ "Mac->abs2rel('hd:d1:d2:','hd:d1:d2:')",            ':'            ],
683 [ "Mac->abs2rel('hd:d1:d2:','hd:d1:d2:file')",        ':'            ], # ignore base's file portion
684 [ "Mac->abs2rel('hd:d1:d2:file','hd:d1:d2:')",        ':file'        ],
685 [ "Mac->abs2rel('hd:d1:','hd:d1:d2:')",               '::'           ],
686 [ "Mac->abs2rel('hd:d3:','hd:d1:d2:')",               ':::d3:'       ],
687 [ "Mac->abs2rel('hd:d3:','hd:d1:d2::')",              '::d3:'        ],
688 [ "Mac->abs2rel('hd:d1:d4:d5:','hd:d1::d2:d3::')",    '::d1:d4:d5:'  ],
689 [ "Mac->abs2rel('hd:d1:d4:d5:','hd:d1::d2:d3:')",     ':::d1:d4:d5:' ], # first, resolve updirs in base
690 [ "Mac->abs2rel('hd:d1:d3:','hd:d1:d2:')",            '::d3:'        ],
691 [ "Mac->abs2rel('hd:d1::d3:','hd:d1:d2:')",           ':::d3:'       ],
692 [ "Mac->abs2rel('hd:d3:','hd:d1:d2:')",               ':::d3:'       ], # same as above
693 [ "Mac->abs2rel('hd:d1:d2:d3:','hd:d1:d2:')",         ':d3:'         ],
694 [ "Mac->abs2rel('hd:d1:d2:d3::','hd:d1:d2:')",        ':d3::'        ],
695 [ "Mac->abs2rel('hd1:d3:d4:d5:','hd2:d1:d2:')",       'hd1:d3:d4:d5:'], # volume mismatch
696 [ "Mac->abs2rel('hd:','hd:d1:d2:')",                  ':::'          ],
697
698 [ "Mac->rel2abs(':d3:','hd:d1:d2:')",          'hd:d1:d2:d3:'     ],
699 [ "Mac->rel2abs(':d3:d4:','hd:d1:d2:')",       'hd:d1:d2:d3:d4:'  ],
700 [ "Mac->rel2abs('','hd:d1:d2:')",              ''                 ],
701 [ "Mac->rel2abs('::','hd:d1:d2:')",            'hd:d1:d2::'       ],
702 [ "Mac->rel2abs('::','hd:d1:d2:file')",        'hd:d1:d2::'       ],# ignore base's file portion
703 [ "Mac->rel2abs(':file','hd:d1:d2:')",         'hd:d1:d2:file'    ],
704 [ "Mac->rel2abs('::file','hd:d1:d2:')",        'hd:d1:d2::file'   ],
705 [ "Mac->rel2abs('::d3:','hd:d1:d2:')",         'hd:d1:d2::d3:'    ],
706 [ "Mac->rel2abs('hd:','hd:d1:d2:')",           'hd:'              ], # path already absolute
707 [ "Mac->rel2abs('hd:d3:file','hd:d1:d2:')",    'hd:d3:file'       ],
708 [ "Mac->rel2abs('hd:d3:','hd:d1:file')",       'hd:d3:'           ],
709
710 [ "Epoc->case_tolerant()",         '1'  ],
711
712 [ "Epoc->canonpath('')",                                      ''          ],
713 [ "Epoc->canonpath('///../../..//./././a//b/.././c/././')",   '/a/b/../c' ],
714 [ "Epoc->canonpath('/./')",                                   '/'         ],
715 [ "Epoc->canonpath('/a/./')",                                 '/a'        ],
716
717 # XXX Todo, copied from Unix, but fail. Should they? 2003-07-07 Tels
718 #[ "Epoc->canonpath('/a/.')",                                  '/a'        ],
719 #[ "Epoc->canonpath('/.')",                                    '/'         ],
720
721 [ "Cygwin->case_tolerant()",         '1'  ],
722 [ "Cygwin->catfile('a','b','c')",         'a/b/c'  ],
723 [ "Cygwin->catfile('a','b','./c')",       'a/b/c'  ],
724 [ "Cygwin->catfile('./a','b','c')",       'a/b/c'  ],
725 [ "Cygwin->catfile('c')",                 'c' ],
726 [ "Cygwin->catfile('./c')",               'c' ],
727
728 [ "Cygwin->splitpath('file')",            ',,file'            ],
729 [ "Cygwin->splitpath('/d1/d2/d3/')",      ',/d1/d2/d3/,'      ],
730 [ "Cygwin->splitpath('d1/d2/d3/')",       ',d1/d2/d3/,'       ],
731 [ "Cygwin->splitpath('/d1/d2/d3/.')",     ',/d1/d2/d3/.,'     ],
732 [ "Cygwin->splitpath('/d1/d2/d3/..')",    ',/d1/d2/d3/..,'    ],
733 [ "Cygwin->splitpath('/d1/d2/d3/.file')", ',/d1/d2/d3/,.file' ],
734 [ "Cygwin->splitpath('d1/d2/d3/file')",   ',d1/d2/d3/,file'   ],
735 [ "Cygwin->splitpath('/../../d1/')",      ',/../../d1/,'      ],
736 [ "Cygwin->splitpath('/././d1/')",        ',/././d1/,'        ],
737
738 [ "Cygwin->catpath('','','file')",            'file'            ],
739 [ "Cygwin->catpath('','/d1/d2/d3/','')",      '/d1/d2/d3/'      ],
740 [ "Cygwin->catpath('','d1/d2/d3/','')",       'd1/d2/d3/'       ],
741 [ "Cygwin->catpath('','/d1/d2/d3/.','')",     '/d1/d2/d3/.'     ],
742 [ "Cygwin->catpath('','/d1/d2/d3/..','')",    '/d1/d2/d3/..'    ],
743 [ "Cygwin->catpath('','/d1/d2/d3/','.file')", '/d1/d2/d3/.file' ],
744 [ "Cygwin->catpath('','d1/d2/d3/','file')",   'd1/d2/d3/file'   ],
745 [ "Cygwin->catpath('','/../../d1/','')",      '/../../d1/'      ],
746 [ "Cygwin->catpath('','/././d1/','')",        '/././d1/'        ],
747 [ "Cygwin->catpath('d1','d2/d3/','')",        'd2/d3/'          ],
748 [ "Cygwin->catpath('d1','d2','d3/')",         'd2/d3/'          ],
749
750 [ "Cygwin->splitdir('')",           ''           ],
751 [ "Cygwin->splitdir('/d1/d2/d3/')", ',d1,d2,d3,' ],
752 [ "Cygwin->splitdir('d1/d2/d3/')",  'd1,d2,d3,'  ],
753 [ "Cygwin->splitdir('/d1/d2/d3')",  ',d1,d2,d3'  ],
754 [ "Cygwin->splitdir('d1/d2/d3')",   'd1,d2,d3'   ],
755
756 [ "Cygwin->catdir()",                     ''          ],
757 [ "Cygwin->catdir('/')",                  '/'         ],
758 [ "Cygwin->catdir('','d1','d2','d3','')", '/d1/d2/d3' ],
759 [ "Cygwin->catdir('d1','d2','d3','')",    'd1/d2/d3'  ],
760 [ "Cygwin->catdir('','d1','d2','d3')",    '/d1/d2/d3' ],
761 [ "Cygwin->catdir('d1','d2','d3')",       'd1/d2/d3'  ],
762 [ "Cygwin->catdir('/','d2/d3')",     '/d2/d3'  ],
763
764 [ "Cygwin->canonpath('///../../..//./././a//b/.././c/././')",   '/a/b/../c' ],
765 [ "Cygwin->canonpath('')",                       ''               ],
766 [ "Cygwin->canonpath('a/../../b/c')",            'a/../../b/c'    ],
767 [ "Cygwin->canonpath('/.')",                     '/'              ],
768 [ "Cygwin->canonpath('/./')",                    '/'              ],
769 [ "Cygwin->canonpath('/a/./')",                  '/a'             ],
770 [ "Cygwin->canonpath('/a/.')",                   '/a'             ],
771 [ "Cygwin->canonpath('/../../')",                '/'              ],
772 [ "Cygwin->canonpath('/../..')",                 '/'              ],
773
774 [  "Cygwin->abs2rel('/t1/t2/t3','/t1/t2/t3')",          '.'                  ],
775 [  "Cygwin->abs2rel('/t1/t2/t4','/t1/t2/t3')",          '../t4'              ],
776 [  "Cygwin->abs2rel('/t1/t2','/t1/t2/t3')",             '..'                 ],
777 [  "Cygwin->abs2rel('/t1/t2/t3/t4','/t1/t2/t3')",       't4'                 ],
778 [  "Cygwin->abs2rel('/t4/t5/t6','/t1/t2/t3')",          '../../../t4/t5/t6'  ],
779 #[ "Cygwin->abs2rel('../t4','/t1/t2/t3')",              '../t4'              ],
780 [  "Cygwin->abs2rel('/','/t1/t2/t3')",                  '../../..'           ],
781 [  "Cygwin->abs2rel('///','/t1/t2/t3')",                '../../..'           ],
782 [  "Cygwin->abs2rel('/.','/t1/t2/t3')",                 '../../..'           ],
783 [  "Cygwin->abs2rel('/./','/t1/t2/t3')",                '../../..'           ],
784 #[ "Cygwin->abs2rel('../t4','/t1/t2/t3')",              '../t4'              ],
785 [  "Cygwin->abs2rel('/t1/t2/t3', '/')",                 't1/t2/t3'           ],
786 [  "Cygwin->abs2rel('/t1/t2/t3', '/t1')",               't2/t3'              ],
787 [  "Cygwin->abs2rel('t1/t2/t3', 't1')",                 't2/t3'              ],
788 [  "Cygwin->abs2rel('t1/t2/t3', 't4')",                 '../t1/t2/t3'        ],
789
790 [ "Cygwin->rel2abs('t4','/t1/t2/t3')",             '/t1/t2/t3/t4'    ],
791 [ "Cygwin->rel2abs('t4/t5','/t1/t2/t3')",          '/t1/t2/t3/t4/t5' ],
792 [ "Cygwin->rel2abs('.','/t1/t2/t3')",              '/t1/t2/t3'       ],
793 [ "Cygwin->rel2abs('..','/t1/t2/t3')",             '/t1/t2/t3/..'    ],
794 [ "Cygwin->rel2abs('../t4','/t1/t2/t3')",          '/t1/t2/t3/../t4' ],
795 [ "Cygwin->rel2abs('/t1','/t1/t2/t3')",            '/t1'             ],
796 [ "Cygwin->rel2abs('//t1/t2/t3','/foo')",          '//t1/t2/t3'      ],
797
798 ) ;
799
800 can_ok('File::Spec::Win32', '_cwd');
801
802 {
803     package File::Spec::FakeWin32;
804     use vars qw(@ISA);
805     @ISA = qw(File::Spec::Win32);
806
807     sub _cwd { 'C:\\one\\two' }
808
809     # Some funky stuff to override Cwd::getdcwd() for testing purposes,
810     # in the limited scope of the rel2abs() method.
811     if ($Cwd::VERSION && $Cwd::VERSION gt '2.17') {  # Avoid a 'used only once' warning
812         local $^W;
813         *rel2abs = sub {
814             my $self = shift;
815             local $^W;
816             local *Cwd::getdcwd = sub {
817               return 'D:\alpha\beta' if $_[0] eq 'D:';
818               return 'C:\one\two'    if $_[0] eq 'C:';
819               return;
820             };
821             *Cwd::getdcwd = *Cwd::getdcwd; # Avoid a 'used only once' warning
822             return $self->SUPER::rel2abs(@_);
823         };
824         *rel2abs = *rel2abs; # Avoid a 'used only once' warning
825     }
826 }
827
828 # Tries a named function with the given args and compares the result against
829 # an expected result. Works with functions that return scalars or arrays.
830 for ( @tests ) {
831     my ($function, $expected) = @$_;
832
833     $function =~ s#\\#\\\\#g ;
834     $function =~ s/^([^\$].*->)/File::Spec::$1/;
835     my $got = join ',', eval $function;
836
837  SKIP: {
838         if ($@) {
839             skip "skip $function: $skip_exception", 1
840                 if $@ =~ /^\Q$skip_exception/;
841             is($@, '', $function);
842         } else {
843             is($got, $expected, $function);
844         }
845     }
846 }
847
848 is +File::Spec::Unix->canonpath(), undef;
849
850 done_testing();