httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r1200427 - in /httpd/test/framework/trunk/t: htdocs/modules/lua/test.lua modules/lua.t
Date Thu, 10 Nov 2011 17:02:43 GMT
Author: jorton
Date: Thu Nov 10 17:02:43 2011
New Revision: 1200427

URL: http://svn.apache.org/viewvc?rev=1200427&view=rev
Log:
- more lua tests

Modified:
    httpd/test/framework/trunk/t/htdocs/modules/lua/test.lua
    httpd/test/framework/trunk/t/modules/lua.t

Modified: httpd/test/framework/trunk/t/htdocs/modules/lua/test.lua
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/lua/test.lua?rev=1200427&r1=1200426&r2=1200427&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/lua/test.lua (original)
+++ httpd/test/framework/trunk/t/htdocs/modules/lua/test.lua Thu Nov 10 17:02:43 2011
@@ -11,6 +11,10 @@ function handle_version(r)
   r:puts(apache2.version)
 end
 
-function handle_print(r)
-  r:puts("fish");
+function handle_method(r)
+   r:puts(r.method)
+end
+
+function handle_201(r)
+   r.status = 201
 end

Modified: httpd/test/framework/trunk/t/modules/lua.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/lua.t?rev=1200427&r1=1200426&r2=1200427&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/lua.t (original)
+++ httpd/test/framework/trunk/t/modules/lua.t Thu Nov 10 17:02:43 2011
@@ -6,20 +6,19 @@ use Apache::TestRequest;
 use Apache::TestUtil;
 use Apache::TestConfig ();
 
-Apache::TestRequest::module('mod_lua');
 my $config = Apache::Test::config();
 my $server = $config->server;
 my $version = $server->{version};
 
-my $r = GET("/modules/lua/test_hello");
+my $pfx = "/modules/lua";
 
 my @ts = (
-    { url => "/modules/lua/test_hello", code => 200, rcontent => "Hello Lua World!\n",

+    { url => "$pfx/test_hello", rcontent => "Hello Lua World!\n", 
       ctype => "text/plain" },
-    { url => "/modules/lua/translate-me", code => 200, 
-      rcontent => "Hello Lua World!\n" },
-    { url => "/modules/lua/test_version", code => 200, 
-      rcontent => qr(^$version) },
+    { url => "$pfx/translate-me", rcontent => "Hello Lua World!\n" },
+    { url => "$pfx/test_version", rcontent => qr(^$version) },
+    { url => "$pfx/test_method", rcontent => "GET" },
+    { url => "$pfx/test_201", rcontent => "", code => 201 },
 );
 
 plan tests => 3 * scalar @ts, need 'lua';
@@ -27,8 +26,9 @@ plan tests => 3 * scalar @ts, need 'lua'
 for my $t (@ts) {
     my $url = $t->{"url"};
     my $r = GET $url;
-    
-    ok t_cmp($r->code, $t->{"code"}, "code for $url");
+    my $code = $t->{"code"} || 200;
+
+    ok t_cmp($r->code, $code, "code for $url");
     ok t_cmp($r->content, $t->{"rcontent"}, "response content for $url");
     if ($t->{"ctype"}) {
         ok t_cmp($r->header("Content-Type"), $t->{"ctype"}, "c-type for $url");



Mime
View raw message