You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2005/08/07 00:59:58 UTC

cvs commit: embperl/test/html keepspaces.htm

richter     2005/08/06 15:59:58

  Modified:    .        Changes.pod MANIFEST test.pl
  Added:       test/cmp keepspaces.htm
               test/html keepspaces.htm
  Log:
     - Added test for optKeepSpaces
  
  Revision  Changes    Path
  1.276     +1 -0      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.275
  retrieving revision 1.276
  diff -u -r1.275 -r1.276
  --- Changes.pod	6 Aug 2005 22:33:56 -0000	1.275
  +++ Changes.pod	6 Aug 2005 22:59:57 -0000	1.276
  @@ -10,6 +10,7 @@
      - Fixed mail:send tag (Syntax Mail), so that Perl code inside the tag
        for example to set an attribute, is now executed correctly.
      - Documentation cleanup
  +   - Added test for optKeepSpaces
   
   =head4 2.0.rc4 19. Juni 2005
   
  
  
  
  1.105     +2 -0      embperl/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /home/cvs/embperl/MANIFEST,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- MANIFEST	6 Aug 2005 21:47:37 -0000	1.104
  +++ MANIFEST	6 Aug 2005 22:59:57 -0000	1.105
  @@ -296,6 +296,7 @@
   test/cmp/java.htm
   test/cmp/keepreq.htm
   test/cmp/keepreq.htm.2
  +test/cmp/keepspaces.htm
   test/cmp/lists.htm
   test/cmp/loop.htm
   test/cmp/loopperl.htm
  @@ -494,6 +495,7 @@
   test/html/inputjs2.htm
   test/html/java.htm
   test/html/keepreq.htm
  +test/html/keepspaces.htm
   test/html/lists.htm
   test/html/loop.htm
   test/html/loopperl.htm
  
  
  
  1.159     +25 -13    embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.158
  retrieving revision 1.159
  diff -u -r1.158 -r1.159
  --- test.pl	6 Aug 2005 21:47:38 -0000	1.158
  +++ test.pl	6 Aug 2005 22:59:57 -0000	1.159
  @@ -264,6 +264,10 @@
        },
       'heredoc.htm' => { },
       'epglobals.htm' => {},
  +    'keepspaces.htm' => { 
  +        'option'     => 0x100000,
  +        'offline'    => 1,
  +        },
       'post.htm' => {
           'offline'    => 0,
           'reqbody'    => "f1=abc1&f2=1234567890&f3=" . 'X' x 8192,
  @@ -1103,7 +1107,7 @@
   # avoid some warnings:
   
   use vars qw ($httpconfsrc $httpconf $EPPORT $EPPORT2 *SAVEERR *ERR $EPHTTPDDLL $EPSTARTUP $EPDEBUG
  -             $testshare
  +             $testshare $keepspaces
               $EPSESSIONDS $EPSESSIONCLASS $EPSESSIONVERSION $EPSESSIONXVERSION $EP1COMPAT $EPAPACHEVERSION $EPC_ENABLE
               $opt_offline $opt_ep1 $opt_cgi $opt_modperl $opt_execute $opt_nokill $opt_loop
               $opt_multchild $opt_memcheck $opt_exitonmem $opt_exitonsv $opt_config $opt_nostart $opt_uniquefn
  @@ -1362,16 +1366,19 @@
       local $^W = 0 ;
   
       chomp ($_[0]) ;
  -    if ($_[0] =~ /(.*?)\s*\r$/) 
  -	{
  -	$_[0] = $1
  -	}
  -    elsif ($_[0] =~ /(.*?)\s*$/) 
  -	{
  -	$_[0] = $1
  -	}
  -    $_[0] =~ s/\s+/ /g ;
  -    $_[0] =~ s/\s+>/>/g ;
  +    if (!$keepspaces)
  +        {
  +        if ($_[0] =~ /(.*?)\s*\r$/) 
  +	    {
  +	    $_[0] = $1
  +	    }
  +        elsif ($_[0] =~ /(.*?)\s*$/) 
  +	    {
  +	    $_[0] = $1
  +	    }
  +        $_[0] =~ s/\s+/ /g ;
  +        $_[0] =~ s/\s+>/>/g ;
  +        }
       }
   
   #####################################################
  @@ -1467,8 +1474,11 @@
   		}
   	    else
   		{
  -		$l1 =~ s/\s//g ;
  -		$l2 =~ s/\s//g ;
  +	        if (!$keepspaces)
  +                    {
  +        	    $l1 =~ s/\s//g ;
  +		    $l2 =~ s/\s//g ;
  +                    }
   		$eq = lc ($l1) eq lc ($l2) ;
   		}
   	    }
  @@ -1825,6 +1835,7 @@
   
   #@tests = @tests2 if ($EP2) ;
   $startnumber = 0 ;
  +$keepspaces  = 0 ;
   
   if ($#ARGV >= 0)
       {
  @@ -2025,6 +2036,7 @@
   	        
   	        if ($err == 0 && $errin != 500 && $file ne 'notfound.htm' && $file ne 'notallow.xhtm')
   		    {
  +                    local $keepspaces = $test -> {option} && ($test -> {option} & 0x100000)?1:0 ;
   		    $page =~ /.*\/(.*)$/ ;
   		    $org = "$cmppath/$1" ;
   		    $org = "$cmppath$testversion/$1" if (-e "$cmppath$testversion/$1") ;
  
  
  
  1.1                  embperl/test/cmp/keepspaces.htm
  
  Index: keepspaces.htm
  ===================================================================
  1
  2
  3
  4
  5
     6
  7 7.1      7.2
  8
  
  
  after sub foo
  
  call sub foo 
  
  foo2  foo2.2
  
       more text
  
  call sub foo  2
  
  
  
  foo2  foo2.2
  
  
  
  more text 2
  
  
  
  
  
  call sub bar inbar      after call to bar
  
  call sub bar 2
  
  inbar 
  
  after call to bar 2
  
  
  # new line 1
  
  # new line 2
  
  # new line 3
  
  # new line 4
  
  # new line 5
  
  
  
  
  
  
  
  1.1                  embperl/test/html/keepspaces.htm
  
  Index: keepspaces.htm
  ===================================================================
  1
  2
  3
  [$if 1 $]4
  5
  [$endif$]   6
  7 [+ 7.1 +]      7.2
  8
  [$sub foo $]
  
  foo2 [$if 0 $] foo2.1 [$endif$] foo2.2
  
  [$endsub$]
  
  after sub foo
  
  call sub foo [- foo -]     more text
  
  call sub foo  2
  
  [- foo -]
  
  more text 2
  
  
  [$sub bar$]inbar[$endsub$]
  
  
  call sub bar [- bar -]      after call to bar
  
  call sub bar 2
  
  [- bar -] 
  
  after call to bar 2
  
  [$foreach $i (1..5) $]
  # new line [+ $i +]
  [$endforeach$]
  
  
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org