Changeset 2127
- Timestamp:
- 04/15/08 10:03:53 (1 month ago)
- Files:
-
- libswish3/trunk/src/t/001-wordcount.t (modified) (2 diffs)
- libswish3/trunk/src/t/004-metanames.t (modified) (1 diff)
- libswish3/trunk/src/t/SwishTestUtils.pm (modified) (1 diff)
- libswish3/trunk/src/test_configs/UPPERlower.XML (added)
- libswish3/trunk/src/test_docs/UPPERlower.XML (modified) (1 diff)
- libswish3/trunk/src/test_docs/properties.html (modified) (1 diff)
- libswish3/trunk/src/test_stdin/test.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libswish3/trunk/src/t/001-wordcount.t
r2116 r2127 3 3 use strict; 4 4 use warnings; 5 use Test::More tests => 2 2;5 use Test::More tests => 23; 6 6 use SwishTestUtils; 7 7 8 8 my %docs = ( 9 'UPPERlower.XML' => '1 7',9 'UPPERlower.XML' => '19', 10 10 'badxml.xml' => '10', 11 11 'contractions.xml' => '13', … … 27 27 'no_words.html' => '0', 28 28 'html_broken.html' => '2', 29 'properties.html' => 1 7,29 'properties.html' => 19, 30 30 31 31 ); 32 32 33 33 my %stdindocs = ( 34 'doc.xml' => '8407' 34 'doc.xml' => '8407', 35 'test.txt' => 1, 35 36 36 37 ); libswish3/trunk/src/t/004-metanames.t
r2116 r2127 2 2 use strict; 3 3 use warnings; 4 use Test::More tests => 4;4 use Test::More tests => 10; 5 5 use SwishTestUtils; 6 6 7 7 $ENV{SWISH_DEBUG_NAMEDBUFFER} = 1; 8 8 9 my $buf 10 = SwishTestUtils::run_get_stderr( 'properties.html', 'properties.xml' ); 9 ok( my $buf 10 = SwishTestUtils::run_get_stderr( 'properties.html', 11 'properties.xml' ), 12 "properties.html" 13 ); 11 14 12 15 like( $buf, qr!<swishtitle>properties test page title</swishtitle>!, 13 16 "swishtitle" ); 14 17 15 like( $buf, qr!<swishdefault> substr: properties test page title\n!, 16 "title" ); 17 like( $buf, qr!<swishdefault> substr: properties test page meta1\n!, 18 "meta1" ); 19 20 like( $buf, qr!<meta1>properties test page meta1</meta1>!, "meta1" ); 18 like( $buf, qr!<meta1> substr: properties test page meta1!, "first meta1" ); 19 like( $buf, qr!<meta1> substr: more meta1!, "second meta1" ); 21 20 22 21 #diag($buf); 22 23 ok( $buf 24 = SwishTestUtils::run_get_stderr( 'UPPERlower.XML', 25 'UPPERlower.XML' ), 26 "UPPERlower.XML" 27 ); 28 29 like( $buf, qr!<swishtitle>mytitle here</swishtitle>!, "swishtitle" ); 30 like( $buf, qr!<mytag1> substr: \s+ some text!s, "mytag1" ); 31 like( $buf, qr!<mytag1> substr: \s+ yet again\s+and again!s, "mytag1 again" ); 32 like( $buf, qr!<mytag3.foo> substr: \s+ blah blah!s, "mytag3.foo" ); 33 like( $buf, qr!<mytag3> substr: \s+ foo bar!s, "mytag3" ); libswish3/trunk/src/t/SwishTestUtils.pm
r2116 r2127 15 15 my $cmd 16 16 = $config 17 ? "./swish_lint -c configs/$config test_docs/$file 2>&1"17 ? "./swish_lint -c test_configs/$config test_docs/$file 2>&1" 18 18 : "./swish_lint test_docs/$file 2>&1"; 19 19 return join( ' ', `$cmd` ); libswish3/trunk/src/test_docs/UPPERlower.XML
r1913 r2127 7 7 </mytag2> 8 8 yet more text here 9 <mytag3>foo bar</mytag3> 9 10 </mytag1> 10 11 <mytag1> libswish3/trunk/src/test_docs/properties.html
r2117 r2127 3 3 <title>properties test page title</title> 4 4 <meta name="meta1" content="properties test page meta1" /> 5 <meta name="meta1" content="more meta1" /> 5 6 </head> 6 7 <body> 7 8 properties test page body 8 9 9 a bunch of space between 10 10 </body> libswish3/trunk/src/test_stdin/test.txt
r2117 r2127 1 1 Content-Length: 15 2 2 Content-Location: stdin/test.txt 3 Parser-Type: XML 3 4 4 5 <doc>foo</doc>
