1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

pidl: Add more parsing tests.

(This used to be commit e44ee3e60a)
This commit is contained in:
Jelmer Vernooij 2008-01-12 21:37:46 +01:00
parent 79c4bd95b8
commit 0e4be859f2

View File

@ -4,7 +4,7 @@
# Published under the GNU General Public License
use strict;
use Test::More tests => 65 * 2 + 3;
use Test::More tests => 65 * 2 + 5;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util qw(test_errors);
@ -129,4 +129,20 @@ is_deeply($x,
[ { 'FILE' => '<quote>', 'DATA' => '"foobar"',
'TYPE' => 'CPP_QUOTE', 'LINE' => 0 } ]);
# A typedef of a struct without body
$x = Parse::Pidl::IDL::parse_string("interface foo { typedef struct x y; }", "<foo>");
is_deeply($x,
[ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
{ 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => {
TYPE => 'STRUCT', NAME => 'x' } } ],
'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
# A typedef of a struct with empty body
$x = Parse::Pidl::IDL::parse_string("interface foo { typedef struct {} y; }", "<foo>");
is_deeply($x,
[ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
{ 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => {
TYPE => 'STRUCT', ELEMENTS => [] } } ],
'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);