@@ -10,7 +10,7 @@ local yaml = require 'yaml'
1010local urilib = require (' uri' )
1111
1212local test = tap .test (" http" )
13- test :plan (9 )
13+ test :plan (7 )
1414test :test (" split_uri" , function (test )
1515 test :plan (65 )
1616 local function check (uri , rhs )
@@ -370,39 +370,4 @@ test:test("server requests", function(test)
370370 httpd :stop ()
371371end )
372372
373- local function cfgservtwo ()
374- local detached = function (httpd , s , peer )
375- test :test (' Detached hook is called' , function (test )
376- test :plan (1 )
377- test :ok (true , ' hook called' )
378- end )
379- end
380- local path = os.getenv (' LUA_SOURCE_DIR' ) or ' ./'
381- path = fio .pathjoin (path , ' test' )
382- local httpd = http_server .new (' 127.0.0.1' , 12346 , { app_dir = path ,
383- log_requests = false , log_errors = false })
384- :route ({path = ' /ws' , name = ' test' },
385- function ()
386- return {status = 200 ,
387- body = ' ok' ,
388- detach = true ,
389- detach_handler = detached ,
390- }
391- end )
392- return httpd
393- end
394-
395- test :test (" server requests" , function (test )
396- test :plan (2 )
397-
398- local httpd = cfgservtwo ()
399- httpd :start ()
400-
401- local r = http_client .get (' http://127.0.0.1:12346/ws' )
402-
403- test :is (r .status , 200 , ' detached 200' )
404- test :is (r .reason , ' Ok' , ' detached reason' )
405- end
406- )
407-
408373os.exit (test :check () == true and 0 or 1 )
0 commit comments