Changeset 2127

Show
Ignore:
Timestamp:
04/15/08 10:03:53 (1 month ago)
Author:
karpet
Message:

more test refactoring

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libswish3/trunk/src/t/001-wordcount.t

    r2116 r2127  
    33use strict; 
    44use warnings; 
    5 use Test::More tests => 22
     5use Test::More tests => 23
    66use SwishTestUtils; 
    77 
    88my %docs = ( 
    9     'UPPERlower.XML'   => '17', 
     9    'UPPERlower.XML'   => '19', 
    1010    'badxml.xml'       => '10', 
    1111    'contractions.xml' => '13', 
     
    2727    'no_words.html'    => '0', 
    2828    'html_broken.html' => '2', 
    29     'properties.html'  => 17
     29    'properties.html'  => 19
    3030 
    3131); 
    3232 
    3333my %stdindocs = ( 
    34     'doc.xml' => '8407' 
     34    'doc.xml' => '8407', 
     35    'test.txt'   => 1, 
    3536 
    3637); 
  • libswish3/trunk/src/t/004-metanames.t

    r2116 r2127  
    22use strict; 
    33use warnings; 
    4 use Test::More tests => 4
     4use Test::More tests => 10
    55use SwishTestUtils; 
    66 
    77$ENV{SWISH_DEBUG_NAMEDBUFFER} = 1; 
    88 
    9 my $buf 
    10     = SwishTestUtils::run_get_stderr( 'properties.html', 'properties.xml' ); 
     9ok( my $buf 
     10        = SwishTestUtils::run_get_stderr( 'properties.html', 
     11        'properties.xml' ), 
     12    "properties.html" 
     13); 
    1114 
    1215like( $buf, qr!<swishtitle>properties test page title</swishtitle>!, 
    1316    "swishtitle" ); 
    1417 
    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" ); 
     18like( $buf, qr!<meta1> substr: properties test page meta1!, "first meta1" ); 
     19like( $buf, qr!<meta1> substr: more meta1!, "second meta1" ); 
    2120 
    2221#diag($buf); 
     22 
     23ok( $buf 
     24        = SwishTestUtils::run_get_stderr( 'UPPERlower.XML', 
     25        'UPPERlower.XML' ), 
     26    "UPPERlower.XML" 
     27); 
     28 
     29like( $buf, qr!<swishtitle>mytitle here</swishtitle>!,       "swishtitle" ); 
     30like( $buf, qr!<mytag1> substr: \s+ some text!s,             "mytag1" ); 
     31like( $buf, qr!<mytag1> substr: \s+ yet again\s+and again!s, "mytag1 again" ); 
     32like( $buf, qr!<mytag3.foo> substr: \s+ blah blah!s,         "mytag3.foo" ); 
     33like( $buf, qr!<mytag3> substr: \s+ foo bar!s,               "mytag3" ); 
  • libswish3/trunk/src/t/SwishTestUtils.pm

    r2116 r2127  
    1515    my $cmd 
    1616        = $config 
    17         ? "./swish_lint -c configs/$config test_docs/$file 2>&1" 
     17        ? "./swish_lint -c test_configs/$config test_docs/$file 2>&1" 
    1818        : "./swish_lint test_docs/$file 2>&1"; 
    1919    return join( ' ', `$cmd` ); 
  • libswish3/trunk/src/test_docs/UPPERlower.XML

    r1913 r2127  
    77   </mytag2> 
    88   yet more text here 
     9   <mytag3>foo bar</mytag3> 
    910 </mytag1> 
    1011 <mytag1> 
  • libswish3/trunk/src/test_docs/properties.html

    r2117 r2127  
    33  <title>properties test page title</title> 
    44  <meta name="meta1" content="properties test page meta1" /> 
     5  <meta name="meta1" content="more meta1" /> 
    56 </head> 
    67 <body> 
    78  properties test page body 
    8      
    99  a bunch of space between 
    1010 </body> 
  • libswish3/trunk/src/test_stdin/test.txt

    r2117 r2127  
    11Content-Length: 15 
    22Content-Location: stdin/test.txt 
     3Parser-Type: XML 
    34 
    45<doc>foo</doc>