xref: /openbsd-src/gnu/usr.bin/perl/dist/ExtUtils-ParseXS/t/105-valid_proto_string.t (revision 6fb12b7054efc6b436584db6cef9c2f85c0d7e27)
1#!/usr/bin/perl
2use strict;
3use warnings;
4use Test::More tests =>  6;
5use ExtUtils::ParseXS::Utilities qw(
6  valid_proto_string
7);
8
9my ($input, $output);
10
11$input = '[\$]';
12$output = valid_proto_string($input);
13is( $output, $input, "Got expected value for <$input>" );
14
15$input = '[$]';
16$output = valid_proto_string($input);
17is( $output, $input, "Got expected value for <$input>" );
18
19$input = '[\$\@]';
20$output = valid_proto_string($input);
21is( $output, $input, "Got expected value for <$input>" );
22
23$input = '[\$alpha]';
24$output = valid_proto_string($input);
25is( $output, 0, "Got expected value for <$input>" );
26
27$input = '[alpha]';
28$output = valid_proto_string($input);
29is( $output, 0, "Got expected value for <$input>" );
30
31$input = '[_]';
32$output = valid_proto_string($input);
33is( $output, $input, "Got expected value for <$input>" );
34
35