Help language development. Donate to The Perl Foundation

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

t/03-actions.rakutest
use Protobuf;
use Test;

my $m = parse-proto($?FILE.IO.parent.parent.child('eg/helloworld.proto').slurp);
my @services = $m.services;
is @services[0].name, 'Greeter', 'service name';
is @services[0].endpoints[0].name, 'SayHello', 'endpoint name';
is @services[0].endpoints[0].request.fields[0].name, 'name', 'field name';
is @services[0].endpoints[0].response.fields[0].name, 'message', 'field name';

done-testing;