You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2015/11/28 00:42:14 UTC

svn commit: r1716932 - /tcl/rivet/branches/2.2/tests/redirect.test

Author: mxmanghi
Date: Fri Nov 27 23:42:14 2015
New Revision: 1716932

URL: http://svn.apache.org/viewvc?rev=1716932&view=rev
Log:
restoring lost tests/redirect.test file

Added:
    tcl/rivet/branches/2.2/tests/redirect.test

Added: tcl/rivet/branches/2.2/tests/redirect.test
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.2/tests/redirect.test?rev=1716932&view=auto
==============================================================================
--- tcl/rivet/branches/2.2/tests/redirect.test (added)
+++ tcl/rivet/branches/2.2/tests/redirect.test Fri Nov 27 23:42:14 2015
@@ -0,0 +1,25 @@
+# redirect.test -- test redirect command.
+#
+# redirect must trigger an AbortScript and have
+# predictable data stored in the abort code
+
+# $Id: $
+
+::tcltest::test bailout-1.1 {redirect command} {
+    apachetest::start {} {
+        RivetServerConf AbortScript "::rivet::apache_log_error err \\\"catching redirect\\\""
+        RivetServerConf AbortScript "set tmpfp \[open redirect_code.txt w+\]"
+        RivetServerConf AbortScript "puts \$tmpfp \[::rivet::abort_code\]"
+        RivetServerConf AbortScript "close \$tmpfp"
+    } {
+        set url "${urlbase}redirect.rvt?base=$urlbase"
+        #puts $url
+        catch {set page1 [::http::geturl $url]}
+        puts "verifying abort code"
+        set rdfp [open redirect_code.txt r]
+        set redirect_code [dict create {*}[read $rdfp]]
+        set r1 [dict exists $redirect_code location]
+        set r2 [dict exists $redirect_code error_code]
+    } 
+    list $r1 $r2
+} {1 1}



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