X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=Equinox-Migration%2Ft%2F01-SimpleTagList.t;h=0d4c9a4f32914b273caa0ac01e7d6380a84e3e11;hp=d8de31577ff590be545511f7f6c71276909a9d35;hb=7331ec680f6f2f9bd510cafeb6786f68e78adc9e;hpb=35e64a96c229e62ebc1a8260ae5bd446fbaf7492 diff --git a/Equinox-Migration/t/01-SimpleTagList.t b/Equinox-Migration/t/01-SimpleTagList.t index d8de315..0d4c9a4 100644 --- a/Equinox-Migration/t/01-SimpleTagList.t +++ b/Equinox-Migration/t/01-SimpleTagList.t @@ -1,13 +1,13 @@ #!perl -T -use Test::More tests => 45; +use Test::More tests => 51; #use Test::More qw(no_plan); use Equinox::Migration::SimpleTagList; # baseline object creation eval { my $stl = Equinox::Migration::SimpleTagList->new( file => "thefileisalie.txt" ) }; -is ($@ =~ /^Can't open tags file:/, 1, 'cannot open that'); +is ($@ =~ /^Can't open tags file 'thefileisalie\.txt':/, 1, 'cannot open that'); my $stl = Equinox::Migration::SimpleTagList->new(); is(ref $stl, "Equinox::Migration::SimpleTagList", "self is self"); @@ -59,17 +59,23 @@ is ($stl->has(12), 1); is ($stl->has('012'), 1); is ($stl->has(241), 1); is ($stl->has(359), 1); +is ($stl->has(400), 1); +is ($stl->has(416), 1); is ($stl->has(652), 1); is ($stl->has(654), 1); is ($stl->has(656), 1); is ($stl->has(658), 1); +is ($stl->has(797), 1, 'exception is inline commented out'); is ($stl->has(872), 1); is ($stl->has(900), 1); is ($stl->has(999), 1); is ($stl->has(988), 1); +is ($stl->has(411), 0, 'exception'); +is ($stl->has(500), 0, 'inclusion commented out'); is ($stl->has(655), 0, 'exception'); +is ($stl->has(915), 0, 'exception'); is ($stl->has(987), 0, 'exception'); -is ($stl->has(400), 0, 'not in input set'); +is ($stl->has(500), 0, 'not in input set'); $stl = Equinox::Migration::SimpleTagList->new( file => "./t/corpus/stl-1.txt"); is ($stl->has(258), 1); @@ -84,13 +90,11 @@ is ($stl->has(304), 0, 'exception'); # file with bad token $. = 0; $stl = Equinox::Migration::SimpleTagList->new; -$stl->{conf}{file} = "./t/corpus/stl-2.txt"; -eval {$stl->generate}; +eval {$stl->generate("./t/corpus/stl-2.txt")}; is ($@, "Unknown chunk fnord in tags file (line 1)\n"); # file with except in wrong place $. = 0; $stl = Equinox::Migration::SimpleTagList->new; -$stl->{conf}{file} = "./t/corpus/stl-3.txt"; -eval {$stl->generate}; +eval {$stl->generate("./t/corpus/stl-3.txt")}; is ($@, "Keyword 'except' can only follow a range (line 1)\n");