File: runtests_die_nearlyempty.t

package info (click to toggle)
libtest-class-perl 0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 540 kB
  • sloc: perl: 1,706; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 867 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /usr/bin/perl -T

use strict;
use warnings;

package Foo;
use Test::More;
use base qw(Test::Class);

sub die_one_cr : Test(1) {
        die "\n";
        fail 'we should never get here';
}

sub die_two_cr : Test(1) {
        die "\n\n";
        fail 'we should never get here';
}

package main;
use Test::Builder::Tester tests => 1;
$ENV{TEST_VERBOSE}=0;

my $filename = sub { return (caller)[1] }->();

test_out( "not ok 1 - die_one_cr died ()");
test_err( "#   Failed test 'die_one_cr died ()'" );
test_err( "#   at $filename line 36.");
test_err( "#   (in Foo->die_one_cr)" );
test_out( "not ok 2 - die_two_cr died (");
test_out( "# )");
test_err( "#   Failed test 'die_two_cr died (" );
test_err( "# )'");
test_err( "#   at $filename line 36.");
test_err( "#   (in Foo->die_two_cr)" );
Foo->runtests;
test_test("early die with nearly-empty messages handled");