From 7160f1b519aece0fe645d22a7d8fb954a43ad6fb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Sep 2023 19:37:32 +0000 Subject: tests: move broken app test to Perl 5 integration test Less Ruby means fewer incompatibilities to worry about with every new version. --- t/integration.ru | 1 + t/integration.t | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 't') diff --git a/t/integration.ru b/t/integration.ru index 086126a..888833a 100644 --- a/t/integration.ru +++ b/t/integration.ru @@ -98,6 +98,7 @@ run(lambda do |env| when '/pid'; [ 200, {}, [ "#$$\n" ] ] when '/early_hints_rack2'; early_hints(env, "r\n2") when '/early_hints_rack3'; early_hints(env, %w(r 3)) + when '/broken_app'; raise RuntimeError, 'hello' else '/'; [ 200, {}, [ env_dump(env) ] ] end # case PATH_INFO (GET) when 'POST' diff --git a/t/integration.t b/t/integration.t index bea221c..ba17dd9 100644 --- a/t/integration.t +++ b/t/integration.t @@ -118,6 +118,12 @@ SKIP: { is_deeply([grep(/^X-Nil:/, @$hdr)], ['X-Nil: '], 'nil header value accepted for broken apps') or diag(explain($hdr)); +check_stderr; +($status, $hdr, $bdy) = do_req($srv, 'GET /broken_app HTTP/1.0'); +like($status, qr!\AHTTP/1\.[0-1] 500\b!, 'got 500 error on broken endpoint'); +is($bdy, undef, 'no response body after exception'); +truncate($errfh, 0); + my $ck_early_hints = sub { my ($note) = @_; $c = unix_start($u1, 'GET /early_hints_rack2 HTTP/1.0'); -- cgit v1.2.3-24-ge0c7