Debian Codegraph @

t/43probing.t

raw
1 #!/usr/bin/perl
2
3 use v5.14;
4 use warnings;
5
6 use Test2::V0;
7
8 use lib "t";
9 use testcase "t::probing";
10
11 BEGIN { $^H{"t::probing/permit"} = 1; }
12
13 # colon
14 {
15 ok( !probecolon, 'colon absent' );
16 ok( probecolon :, 'colon present' );
17 }
18
19 # literal
20 {
21 ok( !probeliteral, 'literal absent' );
22 ok( probeliteral literal, 'literal present' );
23 }
24
25 # block
26 {
27 ok( !probeblock, 'block absent' );
28 ok( probeblock {}, 'block present' );
29 }
30
31 # ident
32 {
33 ok( !probeident, 'ident absent' );
34 ok( probeident foo, 'ident present' );
35 }
36
37 # packagename
38 {
39 ok( !probepackagename, 'packagename absent' );
40 ok( probepackagename Pkg::Name, 'packagename present' );
41 }
42
43 # vstring
44 {
45 ok( !probevstring, 'vstring absent' );
46 ok( probevstring v1.2.3, 'vstring present' );
47 }
48
49 # choice
50 {
51 ok( !probechoice, 'choice absent' );
52 ok( probechoice x, '1st choice present' );
53 ok( probechoice z, '2nd choice present' );
54 }
55
56 # tagged choice
57 {
58 ok( !probetaggedchoice, 'tagged choice absent' );
59 ok( probetaggedchoice x, '1st tagged choice present' );
60 ok( probetaggedchoice z, '2nd tagged choice present' );
61 }
62
63 # comma list
64 {
65 ok( !probecommalist, 'comma list absent' );
66 is( ( probecommalist a ), 1, 'comma list present x 1' );
67 is( ( probecommalist a, b ), 2, 'comma list present x 2' );
68 }
69
70 # paren scope
71 {
72 ok( !probeparens, 'parens absent' );
73 ok( probeparens (123), 'parens present' );
74 }
75
76 # bracket scope
77 {
78 ok( !probebrackets, 'brackets absent' );
79 ok( probebrackets [123], 'brackets present' );
80 }
81
82 # brace scope
83 {
84 ok( !probebraces, 'braces absent' );
85 ok( probebraces {123}, 'braces present' );
86 }
87
88 # chevron scope
89 {
90 ok( !probechevrons, 'chevrons absent' );
91 ok( probechevrons <abc>, 'chevrons present' );
92 }
93
94 done_testing;