From 7acc0e77a6f6d74d1ccfcf04424a63b224b292a5 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 31 Aug 2007 00:03:54 +0000 Subject: r24815: Support cpp_quote(). (This used to be commit 30c1de30bb4ded16e79316c0ab43809e0e19f75d) --- source4/pidl/tests/header.pl | 5 ++++- source4/pidl/tests/parse_idl.pl | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/pidl/tests') diff --git a/source4/pidl/tests/header.pl b/source4/pidl/tests/header.pl index c7a57eb009..8d0dccf507 100755 --- a/source4/pidl/tests/header.pl +++ b/source4/pidl/tests/header.pl @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 15; +use Test::More tests => 16; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -53,3 +53,6 @@ like(parse_idl("interface p { struct x; };"), like(parse_idl("interface p { typedef struct x { int p; } x; };"), qr/struct x.*{.*int32_t p;.*};/sm, "double struct declaration"); + +like(parse_idl("cpp_quote(\"some-foo\")"), + qr/some-foo/sm, "cpp quote"); diff --git a/source4/pidl/tests/parse_idl.pl b/source4/pidl/tests/parse_idl.pl index b82bd80e54..96c7b2adc8 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 => 64 * 2 + 2; +use Test::More tests => 65 * 2 + 3; use FindBin qw($RealBin); use lib "$RealBin"; use Util qw(test_errors); @@ -109,6 +109,7 @@ testok "import-multiple", "import \"foo.idl\", \"bar.idl\";"; testok "include-multiple", "include \"foo.idl\", \"bar.idl\";"; testok "empty-struct", "interface test { struct foo { }; }"; testok "typedef-double", "interface test { typedef struct foo { } foo; }"; +testok "cpp-quote", "cpp_quote(\"bla\")"; my $x = Parse::Pidl::IDL::parse_string("interface foo { struct x {}; }", ""); @@ -122,3 +123,10 @@ is_deeply($x, [ { 'FILE' => '', 'NAME' => 'foo', 'DATA' => [ { 'NAME' => 'x', 'TYPE' => 'STRUCT' } ], 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]); + +$x = Parse::Pidl::IDL::parse_string("cpp_quote(\"foobar\")", ""); +is_deeply($x, + [ { 'FILE' => '', 'DATA' => '"foobar"', + 'TYPE' => 'CPP_QUOTE', 'LINE' => 0 } ]); + + -- cgit