File: 000.1-home.t

package info (click to toggle)
libdata-printer-perl 1.002001-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 748 kB
  • sloc: perl: 4,364; makefile: 7; sh: 1
file content (24 lines) | stat: -rw-r--r-- 627 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;
use Test::More tests => 4;

use Data::Printer::Config;
{
    local %ENV = %ENV;
    $ENV{HOME} = '/ddp-home';
    is Data::Printer::Config::_my_home(), '/ddp-home', 'found HOME in env';
    delete $ENV{HOME};

    diag('$^O is ' . $^O);
    ok Data::Printer::Config::_my_home(), 'found home without env';

    ok Data::Printer::Config::_project_home(), 'found project home';
    {
        local $0;
        eval { $0 = '-e'; };
        SKIP: {
            skip 'unable to change $0', 1 unless $0 eq '-e';
            ok Data::Printer::Config::_project_home(), 'found project home';
        };
    }
}