Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t/porting/header_parser.t: un-TODO warnings test #23049

Merged
merged 1 commit into from
Mar 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions t/porting/header_parser.t
Original file line number Diff line number Diff line change
Expand Up @@ -981,22 +981,24 @@ EOF_BLURB
{
my @warn;
local $SIG{__WARN__}= sub { push @warn, $_[0]; warn $_[0] };
local $::TODO;
$::TODO= "Absorbtion not implemented yet";
# currently we don't handle absorbtion: (A && (A || B || C ...)) == A
my $hp= HeaderParser->new(debug=>0,add_commented_expr_after=>0);
$hp->parse_text(<<~'EOF');
#if defined(X) && (defined(X) || defined(Y))
#define HAS_X
#endif
EOF
my $grouped= $hp->group_content();
my $as_text= $hp->lines_as_str($grouped);
is($as_text,<<~'EOF',my $tname= "simplification by absorbtion"); # or show_text($as_text);
#if defined(X)
# define HAS_X
#endif /* defined(X) */
EOF
my $tname = "simplification by absorbtion";
{
local $::TODO = "Absorbtion not implemented yet";
# currently we don't handle absorbtion: (A && (A || B || C ...)) == A
my $hp= HeaderParser->new(debug=>0,add_commented_expr_after=>0);
$hp->parse_text(<<~'EOF');
#if defined(X) && (defined(X) || defined(Y))
#define HAS_X
#endif
EOF
my $grouped= $hp->group_content();
my $as_text= $hp->lines_as_str($grouped);
is($as_text,<<~'EOF', $tname); # or show_text($as_text);
#if defined(X)
# define HAS_X
#endif /* defined(X) */
EOF
}
is(join("\n",@warn),"", "No warnings generated from $tname");
}
{
Expand Down