File: 11keywords.t

package info (click to toggle)
libb-keywords-perl 1.08-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 68 kB
  • ctags: 8
  • sloc: perl: 381; makefile: 43
file content (27 lines) | stat: -rw-r--r-- 629 bytes parent folder | download
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
use strict;
BEGIN { $^W = 1 }
use Test;
BEGIN { plan tests => 1 }

use Config;
use File::Spec;
use lib qw( ../lib lib );
use B::Keywords qw( @Symbols @Functions @Barewords );

my $keywords = File::Spec->catfile( $Config{archlibexp}, 'CORE', 'keywords.h' );
open FH, "< $keywords\0" or die "Can't open $keywords: $!";
local $/;
chomp( my @keywords = <FH> =~ /^\#define \s+ KEY_(\S+) /xmsg );
close FH;

my %covered;
@covered{ @Symbols } = ();
@covered{ @Functions } = ();
@covered{ @Barewords } = ();

my @missing = grep { ! exists $covered{$_} } @keywords;

ok( ! @missing );
if ( @missing ) {
    diag( "Missing: @missing" );
}