File: 05-typekind.t

package info (click to toggle)
libclang-perl 0.09-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 297; cpp: 55; makefile: 10; ansic: 8
file content (23 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!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;

is($cursr -> type -> kind -> spelling, 'Invalid');

my $cursors = $cursr -> children;

my @spellings = map { $_ -> type -> kind -> spelling } @$cursors;
my @expected  = qw(
	FunctionProto
	FunctionProto
);

is_deeply(\@spellings, \@expected);

done_testing;