File: special_names.t

package info (click to toggle)
perl 5.32.1-4%2Bdeb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 113,408 kB
  • sloc: ansic: 641,443; perl: 491,650; sh: 70,967; pascal: 8,354; cpp: 4,103; xml: 2,428; makefile: 2,237; yacc: 1,173; lisp: 1
file content (88 lines) | stat: -rw-r--r-- 1,314 bytes parent folder | download | duplicates (9)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use strict;
use warnings;
# HARNESS-NO-FORMATTER

use Test2::Tools::Tiny;

#########################
#
# This test us here to insure that Ok renders the way we want
#
#########################

use Test2::API qw/test2_stack/;

# Ensure the top hub is generated
test2_stack->top;

my $temp_hub = test2_stack->new_hub();
require Test2::Formatter::TAP;
$temp_hub->format(Test2::Formatter::TAP->new);

my $ok = capture {
    ok(1);
    ok(1, "");
    ok(1, " ");
    ok(1, "A");
    ok(1, "\n");
    ok(1, "\nB");
    ok(1, "C\n");
    ok(1, "\nD\n");
    ok(1, "E\n\n");
};

my $not_ok = capture {
    ok(0);
    ok(0, "");
    ok(0, " ");
    ok(0, "A");
    ok(0, "\n");
    ok(0, "\nB");
    ok(0, "C\n");
    ok(0, "\nD\n");
    ok(0, "E\n\n");
};

test2_stack->pop($temp_hub);

is($ok->{STDERR}, "", "STDERR for ok is empty");
is($ok->{STDOUT}, <<EOT, "STDOUT looks right for ok");
ok 1
ok 2 -_
ok 3 - _
ok 4 - A
ok 5 -_
#     _
ok 6 -_
#      B
ok 7 - C
#     _
ok 8 -_
#      D
#     _
ok 9 - E
#     _
#     _
EOT

is($not_ok->{STDOUT}, <<EOT, "STDOUT looks right for not ok");
not ok 10
not ok 11 -_
not ok 12 - _
not ok 13 - A
not ok 14 -_
#          _
not ok 15 -_
#           B
not ok 16 - C
#          _
not ok 17 -_
#           D
#          _
not ok 18 - E
#          _
#          _
EOT


done_testing;