aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMu Qiao <qiaomuf@gentoo.org>2011-04-13 15:07:33 +0800
committerMu Qiao <qiaomuf@gentoo.org>2011-04-14 09:20:31 +0800
commit604169c50644cafde6af6b3cbed4aea6db4df721 (patch)
tree1c40a21ad07915c423c8b83d5c7b2c5b7d3be4e3 /test
parentMove functions to @member section (diff)
downloadlibbash-604169c50644cafde6af6b3cbed4aea6db4df721.tar.gz
libbash-604169c50644cafde6af6b3cbed4aea6db4df721.tar.bz2
libbash-604169c50644cafde6af6b3cbed4aea6db4df721.zip
Support referring a whole array
Syntax like ${array[@]} and ${array[*]} is supported now. Currently the only difference between the two is when they are used in a double quoted string, ${array[*]} will use the first character of IFS as delimiter rather than space. Rename some variables in test script for better ordering.
Diffstat (limited to 'test')
-rw-r--r--test/variable_printer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/variable_printer.cpp b/test/variable_printer.cpp
index 32fc161..ed4aa69 100644
--- a/test/variable_printer.cpp
+++ b/test/variable_printer.cpp
@@ -44,6 +44,8 @@ int main(int argc, char** argv)
libbash::interpret(argv[1], variables);
std::map<std::string, std::vector<std::string>> sorted(variables.begin(), variables.end());
+ // Currently we don't need internal variables
+ sorted.erase("IFS");
using namespace boost::spirit::karma;
std::cout << format((string << '=' << -(string % ' ')) % eol, sorted) << std::endl;