You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by da...@apache.org on 2002/01/24 17:05:07 UTC

cvs commit: tcl-rivet/tests include.html include.rvt include.test rivet.test

davidw      02/01/24 08:05:07

  Modified:    .        ChangeLog
               rivet/rivet-tcl debug.tcl
               src      rivetCore.c
               tests    rivet.test
  Added:       tests    include.html include.rvt include.test
  Log:
  * tests/include.test: Added test for 'include' command.
  
  Revision  Changes    Path
  1.26      +4 -0      tcl-rivet/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/ChangeLog,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ChangeLog	22 Jan 2002 21:37:42 -0000	1.25
  +++ ChangeLog	24 Jan 2002 16:05:07 -0000	1.26
  @@ -1,3 +1,7 @@
  +2002-01-24  David N. Welton  <da...@dedasys.com>
  +
  +	* tests/include.test: Added test for 'include' command.
  +
   2002-01-22  David N. Welton  <da...@dedasys.com>
   
   	* src/mod_rivet.c, src/channel.c, src/rivetCore.c: Switched to
  
  
  
  1.2       +1 -1      tcl-rivet/rivet/rivet-tcl/debug.tcl
  
  Index: debug.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/rivet/rivet-tcl/debug.tcl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- debug.tcl	9 Jan 2002 15:55:03 -0000	1.1
  +++ debug.tcl	24 Jan 2002 16:05:07 -0000	1.2
  @@ -13,7 +13,7 @@
   ##    Options:
   ##	-subst <on|off> - Each word should be considered a variable and subst'd.
   ##	-separator <string> - A text string that goes between each variable.
  -##	-ip <ip address> - A list of IP addresses to display to.	
  +##	-ip <ip address> - A list of IP addresses to display to.
   ###
   
   proc debug {args} {
  
  
  
  1.9       +7 -6      tcl-rivet/src/rivetCore.c
  
  Index: rivetCore.c
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/rivetCore.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- rivetCore.c	22 Jan 2002 21:37:42 -0000	1.8
  +++ rivetCore.c	24 Jan 2002 16:05:07 -0000	1.9
  @@ -2,7 +2,7 @@
    * rivetCore.c - Core commands which are compiled into mod_rivet itself.
    */
   
  -/* $Id: rivetCore.c,v 1.8 2002/01/22 21:37:42 davidw Exp $ */
  +/* $Id: rivetCore.c,v 1.9 2002/01/24 16:05:07 davidw Exp $ */
   
   #include "httpd.h"
   #include "http_config.h"
  @@ -218,7 +218,7 @@
   	}
   	ap_table_set(globals->r->headers_out, "Location",
   		     Tcl_GetStringFromObj (objv[2], (int *)NULL));
  -	globals->r->status = 301;
  +	TclWeb_SetStatus(301, globals->req);
   	return TCL_RETURN;
       }
       else if (!strcmp("set", opt)) /* ### set ### */
  @@ -239,7 +239,7 @@
   	    Tcl_WrongNumArgs(interp, 2, objv, "mime/type");
   	    return TCL_ERROR;
   	}
  -	TclWeb_SetHeaderType(Tcl_GetStringFromObj(objv[2],(int *)NULL), globals->req);
  +	TclWeb_SetHeaderType(Tcl_GetStringFromObj(objv[2], (int *)NULL), globals->req);
       } else if (!strcmp("numeric", opt)) /* ### numeric ### */
       {
   	int st = 200;
  @@ -249,10 +249,11 @@
   	    Tcl_WrongNumArgs(interp, 2, objv, "response code");
   	    return TCL_ERROR;
   	}
  -	if (Tcl_GetIntFromObj(interp, objv[2], &st) != TCL_ERROR)
  -	    globals->r->status = st;
  -	else
  +	if (Tcl_GetIntFromObj(interp, objv[2], &st) != TCL_ERROR) {
  +	    TclWeb_SetStatus(st, globals->req);
  +	} else {
   	    return TCL_ERROR;
  +	}
       } else {
   	return TCL_ERROR;
       }
  
  
  
  1.8       +2 -2      tcl-rivet/tests/rivet.test
  
  Index: rivet.test
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/tests/rivet.test,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- rivet.test	8 Jan 2002 17:47:36 -0000	1.7
  +++ rivet.test	24 Jan 2002 16:05:07 -0000	1.8
  @@ -6,7 +6,7 @@
   
   # See README file for more information.
   
  -# $Id: rivet.test,v 1.7 2002/01/08 17:47:36 damonc Exp $
  +# $Id: rivet.test,v 1.8 2002/01/24 16:05:07 davidw Exp $
   
   package require tcltest
   package require http
  @@ -18,7 +18,7 @@
   # with the desired result, which is placed after the block of code.
   # See man tcltest for more information.
   
  -foreach Test {cookies.test get.test post.test tclfile.test env.test hello.test} {
  +foreach Test {cookies.test get.test post.test tclfile.test env.test hello.test include.test} {
       source $Test
   }
   
  
  
  
  1.1                  tcl-rivet/tests/include.html
  
  Index: include.html
  ===================================================================
      <table>
        <tbody>
  	<tr>
  	  <td>row 1</td>
  	</tr>
  	<tr>
  	  <td>row 2</td>
  	</tr>
        </tbody>
      </table>
  
  
  1.1                  tcl-rivet/tests/include.rvt
  
  Index: include.rvt
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <html>
    <head>
      <title>Include Test</title>
    </head>
  
    <body>
      <h1>Include Test</h1>
      <? include include.html ?>
    </body>
  </html>
  
  
  1.1                  tcl-rivet/tests/include.test
  
  Index: include.test
  ===================================================================
  # $Id: include.test,v 1.1 2002/01/24 16:05:07 davidw Exp $
  
  set testfilename1 include.rvt
  
  ::tcltest::test include-1.1 {Include command} {
      set page [ ::http::geturl "${urlbase}$testfilename1" ]
      set fl [open /tmp/foobar w]
      set foo [::http::data $page]
      puts -nonewline $fl $foo
      set foo
  } {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <html>
    <head>
      <title>Include Test</title>
    </head>
  
    <body>
      <h1>Include Test</h1>
      
      <table>
        <tbody>
  	<tr>
  	  <td>row 1</td>
  	</tr>
  	<tr>
  	  <td>row 2</td>
  	</tr>
        </tbody>
      </table>
    </body>
  </html>
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org