Help language development. Donate to The Perl Foundation

Protobuf cpan:BDUGGAN last updated on 2021-10-12

t/04-nested.rakutest
use Protobuf;
use Test;

my $m = parse-proto($?FILE.IO.parent.parent.child('eg/nested.proto').slurp);
my $service = $m.services[0];
is $service.endpoints[1].request.fields[0].type.name, 'HelloRequest', 'type name';
is $service.endpoints[1].request.fields[0].type.fields[0].name, 'name', 'type has nested attributes';
nok $service.endpoints[1].request.fields[0].type.repeated, 'not repeated';

is $service.endpoints[2].request.fields[0].name, 'holas', 'holas';
ok $service.endpoints[2].request.fields[0].repeated, 'repeated';

done-testing;