Tests: Perl script with syntax error.

This commit is contained in:
Andrey Zelenkov
2018-04-02 19:20:11 +03:00
parent 1583d659ab
commit 151160c110
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
my $app = sub {
my ($environ) = @_
return ['200', [], []];
};

View File

@@ -135,6 +135,16 @@ class TestUnitPerlApplication(unit.TestUnitApplicationPerl):
self.assertEqual(self.get()['body'], 'body\n', 'body io file')
@unittest.expectedFailure
def test_perl_application_syntax_error(self):
self.skip_alerts.extend([
r'PSGI: Failed to parse script',
r'process \d+ exited on signal'
])
self.load('syntax_error')
self.assertEqual(self.get()['status'], 500, 'syntax error')
def test_perl_keepalive_body(self):
self.load('variables')