From 68558575ad51b048deac9500ade5c42f82b4761e Mon Sep 17 00:00:00 2001 From: "Mark M. Hoffman" Date: Sun, 12 Nov 2006 18:21:43 +0000 Subject: [PATCH] Add error conditions for quoted names to scanner regression test. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4234 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/test/names-quoted-errors.conf | 13 +++++++++++++ lib/test/names-quoted-errors.conf.stdout | 19 +++++++++++++++++++ lib/test/test-scanner.pl | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 lib/test/names-quoted-errors.conf create mode 100644 lib/test/names-quoted-errors.conf.stdout diff --git a/lib/test/names-quoted-errors.conf b/lib/test/names-quoted-errors.conf new file mode 100644 index 00000000..d08fa7de --- /dev/null +++ b/lib/test/names-quoted-errors.conf @@ -0,0 +1,13 @@ +chip "blah-*" + +# keyword with two quoted names, no intermediate whitespace +label "in0""foo" + +# missing closing quote before EOL +label "in1" "bar + +# (correct label statement, just for separation) +label "in2" "baz" + +# missing closing quote before immediate EOF +label "in3" "baz \ No newline at end of file diff --git a/lib/test/names-quoted-errors.conf.stdout b/lib/test/names-quoted-errors.conf.stdout new file mode 100644 index 00000000..f06f725d --- /dev/null +++ b/lib/test/names-quoted-errors.conf.stdout @@ -0,0 +1,19 @@ +1: CHIP +1: NAME: blah-* +2: EOL +4: LABEL +4: ERROR +5: EOL +7: LABEL +7: NAME: in1 +7: ERROR +8: EOL +10: LABEL +10: NAME: in2 +10: NAME: baz +11: EOL +13: LABEL +13: NAME: in3 +13: ERROR +13: EOL +13: EOF diff --git a/lib/test/test-scanner.pl b/lib/test/test-scanner.pl index a8ce088a..d125dff4 100755 --- a/lib/test/test-scanner.pl +++ b/lib/test/test-scanner.pl @@ -41,6 +41,8 @@ my @scenarios = ( desc => 'invalid, unquoted names' }, { base => 'names-quoted', status => 0, desc => 'normal, quoted names' }, + { base => 'names-quoted-errors', status => 0, + desc => 'invalid, quoted names' }, ); plan tests => ($#scenarios + 1) * 3;