Clang

 view release on metacpan or  search on metacpan

t/03-cursorkind.t  view on Meta::CPAN

#!perl -T

use Test::More;

use Clang;

my $index = Clang::Index -> new(0);
my $tunit = $index -> parse('t/fragments/test.c');
my $cursr = $tunit -> cursor;
my $kind  = $cursr -> kind;

is($kind -> spelling, 'TranslationUnit');

my $cursors = $cursr -> children;

my @spellings = map { $_ -> kind -> spelling } @$cursors;
my @expected  = qw(
	FunctionDecl
	FunctionDecl
);
is_deeply(\@spellings, \@expected);

done_testing;



( run in 2.866 seconds using v1.01-cache-2.11-cpan-5a3173703d6 )