From 1d302e7d92f49af755d05e60d99d73e710ea4fef Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Tue, 15 Apr 2003 00:04:01 +0000 Subject: [PATCH] Added test for table markup. --- test-markup.pl | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/test-markup.pl b/test-markup.pl index b5b0d356..f946d3b5 100755 --- a/test-markup.pl +++ b/test-markup.pl @@ -38,26 +38,39 @@ close(F); ### SIMPLE MARKUP TESTS -%Test = split('\n',<? +WikiWord: +WikiWord?: OddMuse OddMuse? OddMuse: OddMuse?: OddMuse:test OddMuse:test -WikiWord -WikiWord? -WikiWord: -WikiWord?: -ordinary text -ordinary text +Foo::Bar +Foo::Bar +||one|| +
one
+||one||two||three||\n||||one two||three||\n +
onetwothree
one twothree
EOT +# Now translate embedded newlines +my %New; +foreach (keys %Test) { + $Test{$_} =~ s/\\n/\n/g; + my $new = $Test{$_}; + s/\\n/\n/g; + $New{$_} = $new; +} + # Note that the order of tests is not specified! -foreach my $input (keys %Test) { +foreach my $input (keys %New) { print '.'; open(F,"|perl test-wrapper.pl > $resultfile"); print F $input; @@ -65,11 +78,11 @@ foreach my $input (keys %Test) { open(F,$resultfile); $output = ; close F; - if ($output eq $Test{$input}) { + if ($output eq $New{$input}) { $passed++; } else { $failed++; - print "\n\"", $input, '" -> "', $output, '" instead of "', $Test{$input}, "\"\n"; + print "\n\"", $input, '" -> "', $output, '" instead of "', $New{$input}, "\"\n"; } }