3 BEGIN { unshift(@INC,'../lib') if -d '../lib'; }
15 plan(tests => scalar(2*@tests)+6);
17 foreach $test (@tests) {
18 ($arg,$func,$expect) = split(/\s+/,$test);
20 $rslt = eval "$func('$arg')";
21 is($@, '', "eval func('$arg')");
22 is($rslt, $expect, " result");
26 # Note: This failure may have occurred because your default device
27 # was set using a non-concealed logical name. If this is the case,
28 # you will need to determine by inspection that the two resultant
29 # file specifications shwn above are in fact equivalent.
32 is(rmsexpand('[]'), "\U$ENV{DEFAULT}", 'rmsexpand()') || print $defwarn;
33 is(rmsexpand('from.here'),"\L$ENV{DEFAULT}from.here") || print $defwarn;
34 is(rmsexpand('from'), "\L$ENV{DEFAULT}from") || print $defwarn;
36 is(rmsexpand('from.here','cant:[get.there];2'),
37 'cant:[get.there]from.here;2') || print $defwarn;
40 # Make sure we're using redirected mkdir, which strips trailing '/', since
41 # the CRTL's mkdir can't handle this.
42 ok(mkdir('testdir/',0777), 'using redirected mkdir()');
43 ok(rmdir('testdir/'), ' rmdir()');
47 # Basic VMS to Unix filespecs
48 some_logical_name_not_likely:[where.over]the.rainbow unixify /some_logical_name_not_likely/where/over/the.rainbow
49 [.some_logical_name_not_likely.where.over]the.rainbow unixify some_logical_name_not_likely/where/over/the.rainbow
50 [-.some_logical_name_not_likely.where.over]the.rainbow unixify ../some_logical_name_not_likely/where/over/the.rainbow
51 [.some_logical_name_not_likely.--.where.over]the.rainbow unixify some_logical_name_not_likely/../../where/over/the.rainbow
52 [.some_logical_name_not_likely...where.over]the.rainbow unixify some_logical_name_not_likely/.../where/over/the.rainbow
53 [...some_logical_name_not_likely.where.over]the.rainbow unixify .../some_logical_name_not_likely/where/over/the.rainbow
54 [.some_logical_name_not_likely.where.over...]the.rainbow unixify some_logical_name_not_likely/where/over/.../the.rainbow
55 [.some_logical_name_not_likely.where.over...] unixify some_logical_name_not_likely/where/over/.../
56 [.some_logical_name_not_likely.where.over.-] unixify some_logical_name_not_likely/where/over/../
63 /some_logical_name_not_likely/where/over/the.rainbow vmsify some_logical_name_not_likely:[where.over]the.rainbow
64 some_logical_name_not_likely/where/over/the.rainbow vmsify [.some_logical_name_not_likely.where.over]the.rainbow
65 ../some_logical_name_not_likely/where/over/the.rainbow vmsify [-.some_logical_name_not_likely.where.over]the.rainbow
66 some_logical_name_not_likely/../../where/over/the.rainbow vmsify [-.where.over]the.rainbow
67 .../some_logical_name_not_likely/where/over/the.rainbow vmsify [...some_logical_name_not_likely.where.over]the.rainbow
68 some_logical_name_not_likely/.../where/over/the.rainbow vmsify [.some_logical_name_not_likely...where.over]the.rainbow
69 /some_logical_name_not_likely/.../where/over/the.rainbow vmsify some_logical_name_not_likely:[...where.over]the.rainbow
70 some_logical_name_not_likely/where/... vmsify [.some_logical_name_not_likely.where...]
71 /where/... vmsify where:[...]
76 / vmsify sys$disk:[000000]
78 # Fileifying directory specs
79 down_logical_name_not_likely:[the.garden.path] fileify down_logical_name_not_likely:[the.garden]path.dir;1
80 [.down_logical_name_not_likely.the.garden.path] fileify [.down_logical_name_not_likely.the.garden]path.dir;1
81 /down_logical_name_not_likely/the/garden/path fileify /down_logical_name_not_likely/the/garden/path.dir;1
82 /down_logical_name_not_likely/the/garden/path/ fileify /down_logical_name_not_likely/the/garden/path.dir;1
83 down_logical_name_not_likely/the/garden/path fileify down_logical_name_not_likely/the/garden/path.dir;1
84 down_logical_name_not_likely:[the.garden]path fileify down_logical_name_not_likely:[the.garden]path.dir;1
85 down_logical_name_not_likely:[the.garden]path. fileify # N.B. trailing . ==> null type
86 down_logical_name_not_likely:[the]garden.path fileify
87 /down_logical_name_not_likely/the/garden/path. fileify # N.B. trailing . ==> null type
88 /down_logical_name_not_likely/the/garden.path fileify
91 down_logical_name_not_likely:[the.garden]path.dir;1 pathify down_logical_name_not_likely:[the.garden.path]
92 [.down_logical_name_not_likely.the.garden]path.dir pathify [.down_logical_name_not_likely.the.garden.path]
93 /down_logical_name_not_likely/the/garden/path.dir pathify /down_logical_name_not_likely/the/garden/path/
94 down_logical_name_not_likely/the/garden/path.dir pathify down_logical_name_not_likely/the/garden/path/
95 down_logical_name_not_likely:[the.garden]path pathify down_logical_name_not_likely:[the.garden.path]
96 down_logical_name_not_likely:[the.garden]path. pathify # N.B. trailing . ==> null type
97 down_logical_name_not_likely:[the]garden.path pathify
98 /down_logical_name_not_likely/the/garden/path. pathify # N.B. trailing . ==> null type
99 /down_logical_name_not_likely/the/garden.path pathify
100 down_logical_name_not_likely:[the.garden]path.dir;2 pathify #N.B. ;2
101 __path pathify __path/
102 /down_logical_name_not_likely/the/garden/. pathify /down_logical_name_not_likely/the/garden/./
103 /down_logical_name_not_likely/the/garden/.. pathify /down_logical_name_not_likely/the/garden/../
104 /down_logical_name_not_likely/the/garden/... pathify /down_logical_name_not_likely/the/garden/.../
107 # Both VMS/Unix and file/path conversions
108 down_logical_name_not_likely:[the.garden]path.dir;1 unixpath /down_logical_name_not_likely/the/garden/path/
109 /down_logical_name_not_likely/the/garden/path vmspath down_logical_name_not_likely:[the.garden.path]
110 down_logical_name_not_likely:[the.garden.path] unixpath /down_logical_name_not_likely/the/garden/path/
111 down_logical_name_not_likely:[the.garden.path...] unixpath /down_logical_name_not_likely/the/garden/path/.../
112 /down_logical_name_not_likely/the/garden/path.dir vmspath down_logical_name_not_likely:[the.garden.path]
113 [.down_logical_name_not_likely.the.garden]path.dir unixpath down_logical_name_not_likely/the/garden/path/
114 down_logical_name_not_likely/the/garden/path vmspath [.down_logical_name_not_likely.the.garden.path]
115 __path vmspath [.__path]
116 / vmspath sys$disk:[000000]
118 # Redundant characters in Unix paths
119 //some_logical_name_not_likely/where//over/../the.rainbow vmsify some_logical_name_not_likely:[where]the.rainbow
120 /some_logical_name_not_likely/where//over/./the.rainbow vmsify some_logical_name_not_likely:[where.over]the.rainbow