From b485739edd2ce597b287c25bee991d8dc6909c72 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 27 Mar 2011 17:22:02 -0400 Subject: [PATCH] Add test for a newline in the middle of a string when no line continuation character is used. --- plugins/sudoers/regress/sudoers/test8.in | 8 ++++++++ plugins/sudoers/regress/sudoers/test8.out.ok | 7 +++++++ plugins/sudoers/regress/sudoers/test8.toke.ok | 7 +++++++ 3 files changed, 22 insertions(+) create mode 100644 plugins/sudoers/regress/sudoers/test8.in create mode 100644 plugins/sudoers/regress/sudoers/test8.out.ok create mode 100644 plugins/sudoers/regress/sudoers/test8.toke.ok diff --git a/plugins/sudoers/regress/sudoers/test8.in b/plugins/sudoers/regress/sudoers/test8.in new file mode 100644 index 000000000..d25e8342d --- /dev/null +++ b/plugins/sudoers/regress/sudoers/test8.in @@ -0,0 +1,8 @@ +# Test quoted strings +User_Alias UA1 = "xy" +User_Alias UA2 = "x\ +y" +User_Alias UA3 = x\"y + +# A newline in the middle of a string is an error +User_Alias UA4 = "x diff --git a/plugins/sudoers/regress/sudoers/test8.out.ok b/plugins/sudoers/regress/sudoers/test8.out.ok new file mode 100644 index 000000000..ccea9044c --- /dev/null +++ b/plugins/sudoers/regress/sudoers/test8.out.ok @@ -0,0 +1,7 @@ +Does not parse. + + +User_Alias UA1 = xy +User_Alias UA2 = xy +User_Alias UA3 = x"y + diff --git a/plugins/sudoers/regress/sudoers/test8.toke.ok b/plugins/sudoers/regress/sudoers/test8.toke.ok new file mode 100644 index 000000000..0f7e2a91a --- /dev/null +++ b/plugins/sudoers/regress/sudoers/test8.toke.ok @@ -0,0 +1,7 @@ +# +USERALIAS ALIAS = BEGINSTR STRBODY ENDSTR WORD(4) +USERALIAS ALIAS = BEGINSTR STRBODY STRBODY ENDSTR WORD(4) +USERALIAS ALIAS = WORD(5) + +# +USERALIAS ALIAS = BEGINSTR STRBODY ERROR <*> ERROR \ No newline at end of file -- 2.40.0