Branch: Tag:

2001-06-24

2001-06-24 02:18:46 by Martin Nilsson <mani@lysator.liu.se>

Added a few more HTTP tests.

Rev: server/etc/test/tests/http/RoxenTest_http.pike:1.4
Rev: server/etc/test/tests/http/http010.pike:1.1
Rev: server/etc/test/tests/http/http10.pike:1.5
Rev: server/etc/test/tests/http/http_common.pike:1.6

1: + inherit "http_common";    -  + void main(int argc, array argv) + { +  string sep = "\r\n"; +  int psize = 100000; +  if( argc < 4 ) +  exit( BADARG ); +  +  Stdio.File f = connect( argv[1] ); +  +  write_fragmented( f, +  "GET "+argv[2]+" HTTP/"+argv[4]+sep+ +  "Connection: close"+sep+ +  "User-Agent: testscript"+sep+sep, +  psize ); +  +  string _d = f->read(); +  +  array q = _d/"\r\n\r\n"; +  if( sizeof( q ) < 2 ) +  exit( BADHEADERS ); +  +  verify_headers( q[0], strlen(q[1]), "HTTP/1.0", +  (argv[2] != "/nofile" ? 200 : 404), +  (argv[2][strlen(argv[2])-3..]=="raw")); +  +  if( (int)argv[3] ) +  if( q[1] != ("\0" * (int)argv[3]) ) +  exit( BADDATA ); +  +  exit( OK ); + }   Newline at end of file added.