From 7bef0fb700671841b70b9c9b1da40794c21212e6 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Tue, 22 Nov 2011 14:29:42 +0000 Subject: [PATCH] Clean up coding style in tests --- t/chkstow.t | 14 +++++++------- t/cleanup_invalid_links.t | 10 +++++----- t/find_stowed_path.t | 8 ++++---- t/join_paths.t | 26 +++++++++++++------------- t/parent.t | 8 ++++---- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/t/chkstow.t b/t/chkstow.t index b182fd9..711c33b 100755 --- a/t/chkstow.t +++ b/t/chkstow.t @@ -63,7 +63,7 @@ sub run_chkstow() { check_stow(); } -local @ARGV = ('-t', '.', '-b',); +local @ARGV = ('-t', '.', '-b'); stderr_like( \&run_chkstow, qr{\Askipping .*stow.*\z}xms, @@ -72,19 +72,19 @@ stderr_like( # squelch warn so that check_stow doesn't carp about skipping .stow all the time $SIG{'__WARN__'} = sub { }; -@ARGV = ('-t', '.', '-l',); +@ARGV = ('-t', '.', '-l'); stdout_like( \&run_chkstow, qr{emacs\nperl\nstow\n}xms, "List packages"); -@ARGV = ('-t', '.', '-b',); +@ARGV = ('-t', '.', '-b'); stdout_like( \&run_chkstow, qr{\A\z}xms, "No bogus links exist"); -@ARGV = ('-t', '.', '-a',); +@ARGV = ('-t', '.', '-a'); stdout_like( \&run_chkstow, qr{\A\z}xms, @@ -92,20 +92,20 @@ stdout_like( # Create an alien make_file('bin/alien'); -@ARGV = ('-t', '.', '-a',); +@ARGV = ('-t', '.', '-a'); stdout_like( \&run_chkstow, qr{Unstowed\ file:\ ./bin/alien}xms, "Aliens exist"); make_link('bin/link', 'ireallyhopethisfiledoesn/t.exist'); -@ARGV = ('-t', '.', '-b',); +@ARGV = ('-t', '.', '-b'); stdout_like( \&run_chkstow, qr{Bogus\ link:\ ./bin/link}xms, "Bogus links exist"); -@ARGV = ('-b',); +@ARGV = ('-b'); process_options(); our $Target; ok($Target == q{/usr/local}, diff --git a/t/cleanup_invalid_links.t b/t/cleanup_invalid_links.t index f5802dd..9882487 100755 --- a/t/cleanup_invalid_links.t +++ b/t/cleanup_invalid_links.t @@ -26,7 +26,7 @@ my $stow; make_dir('../stow/pkg1/bin1'); make_file('../stow/pkg1/bin1/file1'); -make_link('bin1','../stow/pkg1/bin1'); +make_link('bin1', '../stow/pkg1/bin1'); $stow = new_Stow(); $stow->cleanup_invalid_links('./'); @@ -41,8 +41,8 @@ is( make_dir('bin2'); make_dir('../stow/pkg2/bin2'); make_file('../stow/pkg2/bin2/file2a'); -make_link('bin2/file2a','../../stow/pkg2/bin2/file2a'); -make_link('bin2/file2b','../../stow/pkg2/bin2/file2b'); +make_link('bin2/file2a', '../../stow/pkg2/bin2/file2a'); +make_link('bin2/file2b', '../../stow/pkg2/bin2/file2b'); $stow = new_Stow(); $stow->cleanup_invalid_links('bin2'); @@ -57,8 +57,8 @@ is($stow->link_task_action('bin2/file2b'), 'remove', 'removal task for bad link' make_dir('bin3'); make_dir('../stow/pkg3/bin3'); make_file('../stow/pkg3/bin3/file3a'); -make_link('bin3/file3a','../../stow/pkg3/bin3/file3a'); -make_link('bin3/file3b','../../empty'); +make_link('bin3/file3a', '../../stow/pkg3/bin3/file3a'); +make_link('bin3/file3b', '../../empty'); $stow = new_Stow(); $stow->cleanup_invalid_links('bin3'); diff --git a/t/find_stowed_path.t b/t/find_stowed_path.t index 199a534..7fac9f0 100755 --- a/t/find_stowed_path.t +++ b/t/find_stowed_path.t @@ -17,7 +17,7 @@ my $stow = new_Stow(dir => 't/stow'); is( $stow->find_stowed_path('t/target/a/b/c', '../../../stow/a/b/c'), - 't/stow/a/b/c', + 't/stow/a/b/c' => 'from root' ); @@ -25,7 +25,7 @@ cd('t/target'); $stow->set_stow_dir('../stow'); is( $stow->find_stowed_path('a/b/c','../../../stow/a/b/c'), - '../stow/a/b/c', + '../stow/a/b/c' => 'from target directory' ); @@ -35,13 +35,13 @@ $stow->set_stow_dir('t/target/stow'); is( $stow->find_stowed_path('t/target/a/b/c', '../../stow/a/b/c'), - 't/target/stow/a/b/c', + 't/target/stow/a/b/c' => 'stow is subdir of target directory' ); is( $stow->find_stowed_path('t/target/a/b/c','../../empty'), - '', + '' => 'target is not stowed' ); diff --git a/t/join_paths.t b/t/join_paths.t index b310416..37157a5 100755 --- a/t/join_paths.t +++ b/t/join_paths.t @@ -13,79 +13,79 @@ use Test::More tests => 13; is( join_paths('a/b/c', 'd/e/f'), - 'a/b/c/d/e/f', + 'a/b/c/d/e/f' => 'simple' ); is( join_paths('/a/b/c', '/d/e/f'), - '/a/b/c/d/e/f', + '/a/b/c/d/e/f' => 'leading /' ); is( join_paths('/a/b/c/', '/d/e/f/'), - '/a/b/c/d/e/f', + '/a/b/c/d/e/f' => 'trailing /' ); is( join_paths('///a/b///c//', '/d///////e/f'), - '/a/b/c/d/e/f', + '/a/b/c/d/e/f' => 'mltiple /\'s' ); is( join_paths('', 'a/b/c'), - 'a/b/c', + 'a/b/c' => 'first empty' ); is( join_paths('a/b/c', ''), - 'a/b/c', + 'a/b/c' => 'second empty' ); is( join_paths('/', 'a/b/c'), - '/a/b/c', + '/a/b/c' => 'first is /' ); is( join_paths('a/b/c', '/'), - 'a/b/c', + 'a/b/c' => 'second is /' ); is( join_paths('///a/b///c//', '/d///////e/f'), - '/a/b/c/d/e/f', + '/a/b/c/d/e/f' => 'multiple /\'s' ); is( join_paths('../a1/b1/../c1/', '/a2/../b2/e2'), - '../a1/c1/b2/e2', + '../a1/c1/b2/e2' => 'simple deref ".."' ); is( join_paths('../a1/b1/../c1/d1/e1', '../a2/../b2/c2/d2/../e2'), - '../a1/c1/d1/b2/c2/e2', + '../a1/c1/d1/b2/c2/e2' => 'complex deref ".."' ); is( join_paths('../a1/../../c1', 'a2/../../'), - '../..', + '../..' => 'too many ".."' ); is( join_paths('./a1', '../../a2'), - '../a2', + '../a2' => 'drop any "./"' ); diff --git a/t/parent.t b/t/parent.t index 52a99bc..2265f88 100755 --- a/t/parent.t +++ b/t/parent.t @@ -13,25 +13,25 @@ use Test::More tests => 5; is( parent('a/b/c'), - 'a/b', + 'a/b' => 'no leading or trailing /' ); is( parent('/a/b/c'), - '/a/b', + '/a/b' => 'leading /' ); is( parent('a/b/c/'), - 'a/b', + 'a/b' => 'trailing /' ); is( parent('/////a///b///c///'), - '/a/b', + '/a/b' => 'multiple /' );