diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-05-31 00:41:21 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-05-31 00:41:21 +0200 |
commit | dd1d30cfe657e86d6281ecb24b11cbe6833fe95b (patch) | |
tree | 868b8e09b82f61f569f0d718f5570317d87848eb /t/13-local-check.t | |
parent | a0ec8a486ce7b6dbf1622c3aa4555e5ede1be1d3 (diff) | |
download | sbotools2-dd1d30cfe657e86d6281ecb24b11cbe6833fe95b.tar.xz |
13-local-check.t: test length of sbocheck output with long sbo names
Diffstat (limited to 't/13-local-check.t')
-rwxr-xr-x | t/13-local-check.t | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/t/13-local-check.t b/t/13-local-check.t index 3d79a9f..50ac947 100755 --- a/t/13-local-check.t +++ b/t/13-local-check.t @@ -10,7 +10,7 @@ use lib $RealBin; use Test::Sbotools qw/ make_slackbuilds_txt set_lo set_repo sbosnap sbocheck sboinstall sbofind restore_perf_dummy /; if ($ENV{TEST_INSTALL} and $ENV{TRAVIS}) { - plan tests => 4; + plan tests => 9; } else { plan skip_all => "Only run these tests if TEST_INSTALL=1 and we're running under Travis CI"; } @@ -19,11 +19,26 @@ sub cleanup { capture_merged { system(qw!/sbin/removepkg nonexistentslackbuild!); system(qw!/sbin/removepkg nonexistentslackbuild5!); + system(qw!/sbin/removepkg nonexistentslackbuildwithareallyverylongnameasyoucansee!); + system(qw!/sbin/removepkg s!); + system(qw!/sbin/removepkg nonexistentslackbuildwithareallyverylo!); + system(qw!/sbin/removepkg nonexistentslackbuildwithareallyverylon!); + system(qw!/sbin/removepkg nonexistentslackbuildwithareallyverylong!); unlink "$RealBin/LO/nonexistentslackbuild/perf.dummy"; system(qw!rm -rf /tmp/SBo/nonexistentslackbuild-1.0!); system(qw!rm -rf /tmp/SBo/nonexistentslackbuild5-1.0!); + system(qw!rm -rf /tmp/SBo/nonexistentslackbuildwithareallyverylongnameasyoucansee-1.0!); + system(qw!rm -rf /tmp/SBo/s-1.0!); + system(qw!rm -rf /tmp/SBo/nonexistentslackbuildwithareallyverylo-1.0!); + system(qw!rm -rf /tmp/SBo/nonexistentslackbuildwithareallyverylon-1.0!); + system(qw!rm -rf /tmp/SBo/nonexistentslackbuildwithareallyverylon-1.0g!); system(qw!rm -rf /tmp/package-nonexistentslackbuild!); system(qw!rm -rf /tmp/package-nonexistentslackbuild5!); + system(qw!rm -rf /tmp/package-nonexistentslackbuildwithareallyverylongnameasyoucansee!); + system(qw!rm -rf /tmp/package-s!); + system(qw!rm -rf /tmp/package-nonexistentslackbuildwithareallyverylo!); + system(qw!rm -rf /tmp/package-nonexistentslackbuildwithareallyverylon!); + system(qw!rm -rf /tmp/package-nonexistentslackbuildwithareallyverylong!); system(qw!rm -rf!, "$RealBin/gitrepo"); }; } @@ -59,6 +74,56 @@ sboinstall 'nonexistentslackbuild', { input => "y\ny", test => 0 }; sboinstall 'nonexistentslackbuild5', { input => "y\ny", test => 0 }; sbocheck { expected => sub { /nonexistentslackbuild/ and not /nonexistentslackbuild5/ } }; +# 5-7: sbocheck should make lines match up as best it can +sboinstall 'nonexistentslackbuildwithareallyverylongnameasyoucansee', { input => "y\ny", test => 0 }; +sboinstall 's', { input => "y\ny", test => 0 }; +sbocheck { expected => sub { /Updating SlackBuilds tree/ and not /nonexistentslackbuildwithareallyverylongnameasyoucansee/ } }; + +capture_merged { system <<"GIT"; }; + cd "$RealBin/gitrepo" + + mkdir -p test/nonexistentslackbuildwithareallyverylongnameasyoucansee test/s + cp "$RealBin"/LO2/nonexistentslackbuildwithareallyverylongnameasyoucansee/* test/nonexistentslackbuildwithareallyverylongnameasyoucansee + cp "$RealBin"/LO2/s/* test/s + git add "test"; git commit -m 'updates'; +GIT + +sbocheck { expected => qr/\Qs 1.0 < override outdated (1.1 from SBo)/ }; + +capture_merged { system <<"GIT"; }; + cd "$RealBin/gitrepo" + + mkdir -p test/nonexistentslackbuildwithareallyverylo + cp "$RealBin"/LO2/nonexistentslackbuildwithareallyverylo/* test/nonexistentslackbuildwithareallyverylo + git add "test"; git commit -m '2nd update' +GIT + +sboinstall 'nonexistentslackbuildwithareallyverylo', { input => "y\ny", test => 0 }; +sbocheck { expected => qr/\Qs 1.0 < override outdated (1.1 from SBo)/ }; + +capture_merged { system <<"GIT"; }; + cd "$RealBin/gitrepo" + + mkdir -p test/nonexistentslackbuildwithareallyverylon + cp "$RealBin"/LO2/nonexistentslackbuildwithareallyverylon/* test/nonexistentslackbuildwithareallyverylon + git add "test"; git commit -m '3rd update' +GIT + +sboinstall 'nonexistentslackbuildwithareallyverylon', { input => "y\ny", test => 0 }; +sbocheck { expected => qr/\Qs 1.0 < override outdated (1.1 from SBo)/ }; + +capture_merged { system <<"GIT"; }; + cd "$RealBin/gitrepo" + + mkdir -p test/nonexistentslackbuildwithareallyverylong + cp "$RealBin"/LO2/nonexistentslackbuildwithareallyverylong/* test/nonexistentslackbuildwithareallyverylong + git add "test"; git commit -m '4th update' +GIT + +sboinstall 'nonexistentslackbuildwithareallyverylong', { input => "y\ny", test => 0 }; +sbocheck { expected => qr/\Qs 1.0 < override outdated (1.1 from SBo)/ }; + + # Cleanup END { cleanup(); |