File: unit_left_curly.t

package info (click to toggle)
libppix-regexp-perl 0.090-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,524 kB
  • sloc: perl: 8,022; makefile: 8
file content (77 lines) | stat: -rw-r--r-- 2,106 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
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
package main;

use 5.006;

use strict;
use warnings;

use Test::More 0.88;	# Because of done_testing();

BEGIN {
    "$]" >= 5.016
	or plan skip_all => 'Dodgy test requires at least Perl 5.16';
}

# Mung with manifest constants, since at the time this was written they
# were undefined.

use PPIx::Regexp::Constant();

# Local constants describing the current removal plans for various
# constructs involving un-escaped left curlys. Everything should be done
# in terms of these because we seem to be shooting at a moving target on
# this issue.
use constant REMOVE_NEVER	=> undef;
use constant REMOVE_PHASE_2	=> '5.030';
use constant REMOVE_PHASE_3	=> '5.032';

{

    no warnings qw{ redefine };
    no warnings;

    # These get hammered over what was loaded above. At least under
    # 5.26.1, we do NOT want an explicit return(), because it seems to
    # prevent the constant from being inlined. MAYBE we don't care about
    # that during testing, but on the other hand, the testing
    # environment should be as much like the live environment as
    # possible.

    sub PPIx::Regexp::Constant::LITERAL_LEFT_CURLY_REMOVED_PHASE_2 () {
	REMOVE_PHASE_2 }	# As of 2018-06-08 this is the plan

    sub PPIx::Regexp::Constant::LITERAL_LEFT_CURLY_REMOVED_PHASE_3 () {
	REMOVE_PHASE_3 }	# As of 2018-06-08 this is the plan

}

use lib qw{ inc };

use My::Module::Test;

parse	( '/x{/' );	# }
value	( failures => [], 0 );
choose	( child => 1, child => 1 );
klass	( 'PPIx::Regexp::Token::Literal' );
content	( '{' );	# }
value	( perl_version_removed => [], REMOVE_PHASE_2 );	# THIS IS THE POINT

parse	( '/ { /x' );	# }
value	( failures => [], 0 );
choose	( child => 1, child => 0 );
klass	( 'PPIx::Regexp::Token::Literal' );
content	( '{' );	# }
value	( perl_version_removed => [], REMOVE_NEVER );	# THIS IS THE POINT

parse	( '/ ( { ) /x' );	# }
value	( failures => [], 0 );
choose	( child => 1, child => 0, child => 0 );
klass	( 'PPIx::Regexp::Token::Literal' );
content	( '{' );	# }
value	( perl_version_removed => [], REMOVE_PHASE_3 );	# THIS IS THE POINT

done_testing;

1;

# ex: set textwidth=72 :