Commit | Line | Data |
---|---|---|
85613cab Z |
1 | #!./perl |
2 | ||
3 | BEGIN { print "1..1\n"; } | |
4 | ||
5 | BEGIN { $SIG{__DIE__} = sub { | |
6 | $_[0] =~ /\Asyntax error at [^ ]+ line ([0-9]+), at EOF/ or exit 1; | |
7 | my $error_line_num = $1; | |
8 | print $error_line_num == $last_line_num ? "ok 1\n" : "not ok 1\n"; | |
9 | exit 0; | |
10 | }; } | |
11 | ||
12 | # the next line causes a syntax error at end of file, to be caught above | |
13 | BEGIN { $last_line_num = __LINE__; } print 1+ |