[go: up one dir, main page]

File: path.t

package info (click to toggle)
rex 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,800 kB
  • sloc: perl: 30,667; xml: 264; makefile: 8
file content (16 lines) | stat: -rw-r--r-- 480 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use Test::More tests => 3;

use Rex::Helper::Path;

my $path = Rex::Helper::Path::resolv_path( "/home/foo/bar/baz", 1 );
is( $path, "/home/foo/bar/baz", "local test absolute path" );

SKIP: {
  skip 'No home directory tests for Windows.', 2 if $^O =~ m/^MSWin/;

  $path = Rex::Helper::Path::resolv_path( "~/bar/baz", 1 );
  like( $path, qr{^/}, "expanded \$HOME" );

  $path = Rex::Helper::Path::resolv_path("~/bar/baz");
  like( $path, qr{^/}, "expanded \$HOME - no local" );
}