summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/parse_idl.pl
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests/parse_idl.pl')
-rwxr-xr-xsource4/pidl/tests/parse_idl.pl16
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/pidl/tests/parse_idl.pl b/source4/pidl/tests/parse_idl.pl
index 265ac7a2bd..727f41a293 100755
--- a/source4/pidl/tests/parse_idl.pl
+++ b/source4/pidl/tests/parse_idl.pl
@@ -4,7 +4,7 @@
# Published under the GNU General Public License
use strict;
-use Test::More tests => 62 * 2;
+use Test::More tests => 63 * 2 + 2;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util qw(test_errors);
@@ -107,3 +107,17 @@ testfail "import-nosemicolon", "import \"foo.idl\"",
"<import-nosemicolon>:0: Syntax error near 'foo.idl'\n";
testok "import-multiple", "import \"foo.idl\", \"bar.idl\";";
testok "include-multiple", "include \"foo.idl\", \"bar.idl\";";
+testok "empty-struct", "interface test { struct foo { }; }";
+
+my $x = Parse::Pidl::IDL::parse_string("interface foo { struct x {}; }", "<foo>");
+
+is_deeply($x,
+ [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
+ { 'NAME' => 'x', 'TYPE' => 'STRUCT', ELEMENTS => [] } ],
+ 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+
+$x = Parse::Pidl::IDL::parse_string("interface foo { struct x; }", "<foo>");
+is_deeply($x,
+ [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
+ { 'NAME' => 'x', 'TYPE' => 'STRUCT' } ],
+ 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);