aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-06-15 15:12:14 +0800
committerPetteri Räty <petsku@petteriraty.eu>2011-06-21 16:23:34 +0300
commit602e860e3ef44afbd8af4b5aafff993a1a0d8aed (patch)
treee0e56c774738d18f42668fd82adcb432fadebf20 /test
parentParser: simplify the AST of brace expansion (diff)
downloadlibbash-602e860e3ef44afbd8af4b5aafff993a1a0d8aed.tar.gz
libbash-602e860e3ef44afbd8af4b5aafff993a1a0d8aed.tar.bz2
libbash-602e860e3ef44afbd8af4b5aafff993a1a0d8aed.zip
Walker: first support for brace expansion
We only support brace expansion in raw string for now. Other cases will cause an interpreter_exception.
Diffstat (limited to 'test')
-rw-r--r--test/walker_test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/walker_test.cpp b/test/walker_test.cpp
index 5a64b04..20cb00d 100644
--- a/test/walker_test.cpp
+++ b/test/walker_test.cpp
@@ -90,3 +90,13 @@ TEST(extglob, used_when_disabled)
EXPECT_STREQ(e.what(), "Entered extended pattern matching with extglob disabled");
}
}
+
+TEST(brace_expansion, not_in_raw_string)
+{
+ interpreter walker;
+
+ std::string script = "echo $ab{c,d}e";
+ std::istringstream input(script);
+ bash_ast ast(input);
+ EXPECT_THROW(ast.interpret_with(walker), libbash::interpreter_exception);
+}