aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-05-25 16:46:10 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-05-25 21:41:12 +0800
commit4c2a0e76310000777d9da7feb4309a2b0565e0fe (patch)
treecf67639d9bb8a1f60c3187eb9ea886a88abea86b /test
parentBuiltin: support shopt -s and -u (diff)
downloadlibbash-4c2a0e76310000777d9da7feb4309a2b0565e0fe.tar.gz
libbash-4c2a0e76310000777d9da7feb4309a2b0565e0fe.tar.bz2
libbash-4c2a0e76310000777d9da7feb4309a2b0565e0fe.zip
Walker: throw exception if extglob used when disabled
Diffstat (limited to 'test')
-rw-r--r--test/walker_test.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/walker_test.cpp b/test/walker_test.cpp
index c3aacbb..41a4fc4 100644
--- a/test/walker_test.cpp
+++ b/test/walker_test.cpp
@@ -74,3 +74,20 @@ TEST(array_index, out_of_bound)
bash_ast ast2(input2);
EXPECT_THROW(ast2.interpret_with(walker), interpreter_exception);
}
+
+TEST(extglob, used_when_disabled)
+{
+ interpreter walker;
+
+ std::string script = "echo ${abc/?([a-z])}";
+ std::istringstream input(script);
+ bash_ast ast(input);
+ try
+ {
+ ast.interpret_with(walker);
+ }
+ catch(interpreter_exception& e)
+ {
+ EXPECT_STREQ(e.what(), "Entered extended pattern matching with extglob disabled");
+ }
+}