Skip to content
Snippets Groups Projects
Commit e3654dd6 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- add encryption/decryption tests

- fixed "dzil install" issue, because it sets env PERL_MM_USE_DEFAULT and therefore breaks IO::Tiny::Prompt
parent 73101a65
Branches
Tags
No related merge requests found
use v5.36; use v5.36;
use Test::Cmd; use Test::Cmd;
use Test::More tests =>7; use Test::More tests =>10;
use Path::Tiny; use Path::Tiny;
my $perl = $^X; my $perl = $^X;
my $testapp = Test::Cmd->new( my $testapp = Test::Cmd->new(
...@@ -11,6 +11,8 @@ my $testapp = Test::Cmd->new( ...@@ -11,6 +11,8 @@ my $testapp = Test::Cmd->new(
interpreter => "$perl -I lib/ ", interpreter => "$perl -I lib/ ",
); );
local $ENV{'HOME'} = $testapp->workpath(); local $ENV{'HOME'} = $testapp->workpath();
$ENV{'TEST_ACTIVE'}=1;
delete $ENV{PERL_MM_USE_DEFAULT};
my $config_dir = path($testapp->workpath())->child('.config'); my $config_dir = path($testapp->workpath())->child('.config');
$config_dir->mkpath(); $config_dir->mkpath();
my $config_file = $config_dir->child('ta-tool.rc'); my $config_file = $config_dir->child('ta-tool.rc');
...@@ -18,6 +20,9 @@ my $cache_dir = path($testapp->workpath())->child('.cache'); ...@@ -18,6 +20,9 @@ my $cache_dir = path($testapp->workpath())->child('.cache');
$cache_dir->mkpath(); $cache_dir->mkpath();
my $cache_file = $cache_dir->child('ta-tool.cache'); my $cache_file = $cache_dir->child('ta-tool.cache');
# tests # tests
use_ok("SLUB::LZA::TA::Crypt");
is(SLUB::LZA::TA::Crypt::encrypt("199fc76b9d086d8937976634e93413bcd005d941"), "839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345", "ta-tool, init, check encryption");
is(SLUB::LZA::TA::Crypt::decrypt("839852bed005a7f1237578a6ac1197c142f7d0dd58bb248446dc7849d4bf770902e7f980ad83d39008ad638bc41e2345"), "199fc76b9d086d8937976634e93413bcd005d941", "ta-tool, init, check encryption");
ok($testapp, "init 'ta-tool'"); ok($testapp, "init 'ta-tool'");
$testapp->run( $testapp->run(
stdin => <<_EOF_, stdin => <<_EOF_,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment