App-NDTools

 view release on metacpan or  search on metacpan

t/bin/nddiff.t  view on Meta::CPAN

    exit => 8,
);

$test = "term_brief_nonref";
run_ok(
    name => $test,
    cmd => [ @cmd, '--brief', "$test.a.data", "$test.b.data" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_brief_colors";
run_ok(
    name => $test,
    cmd => [ @cmd, '--brief', '--colors', "_bool.a.json", "_bool.b.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_colors";
run_ok(
    name => $test,
    cmd => [ @cmd, '--colors', "_cfg.alpha.json", "_cfg.beta.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_colors_wU";
run_ok(
    name => $test,
    cmd => [ @cmd, '--colors', '-U', "_cfg.alpha.json", "_cfg.beta.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_grep_1";
run_ok(
    name => $test,
    cmd => [ @cmd, '--grep', '{list}[1]', "_bool.a.json", "_bool.b.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_grep_2";
run_ok(
    name => $test,
    cmd => [ @cmd, '--grep', '{fqdn}', '--grep', '{mtime}', "_cfg.alpha.json", "_cfg.beta.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_grep_absent_part";
run_ok(
    name => $test,
    cmd => [ @cmd, '--grep', '[1]{Edit}[5]{id}', "_menu.a.json", "_menu.b.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

SKIP: {
    skip "non utf8 locale", 1 unless (exists $ENV{LC_ALL} and $ENV{LC_ALL} =~ /UTF-8/);

    $test = "term_grep_utf8_path";
    run_ok(
        name => $test,
        cmd => [ @cmd, '--grep', '{"текст"}', "_text-utf8.a.json", "_text-utf8.b.json" ],
        stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test, { encoding => 'UTF-8' }) },
        exit => 8,
    );
}

$test = "term_hash";
run_ok(
    name => $test,
    cmd => [ @cmd, "_cfg.alpha.json", "_cfg.beta.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_noA";
run_ok(
    name => $test,
    cmd => [ @cmd, '--noA', "_struct-subkey-AR.a.json", "_struct-subkey-AR.b.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_noAR";
run_ok(
    name => $test,
    cmd => [ @cmd, '--noA', '--noR', "_struct-subkey-AR.a.json", "_struct-subkey-AR.b.json" ],
    exit => 0, # yep, no diff
);

$test = "term_noN";
run_ok(
    name => $test,
    cmd => [ @cmd, '--noN', "_cfg.alpha.json", "_cfg.beta.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_noNO";
run_ok(
    name => $test,
    cmd => [ @cmd, '--noN', '--noO', "_cfg.alpha.json", "_cfg.beta.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_noO";
run_ok(
    name => $test,
    cmd => [ @cmd, '--noO', "_cfg.alpha.json", "_cfg.beta.json" ],
    stdout => sub { file_contents_eq_or_diff("$test.exp", shift, $test) },
    exit => 8,
);

$test = "term_noR";
run_ok(
    name => $test,



( run in 0.716 second using v1.01-cache-2.11-cpan-ceb78f64989 )