1 |
commit: 54caee591483d714686031e8611e6fc564611760 |
2 |
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 26 08:33:22 2011 +0000 |
4 |
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 26 14:56:37 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=54caee59 |
7 |
|
8 |
Test: improve test coverage for declare built-in |
9 |
|
10 |
--- |
11 |
src/builtins/tests/declare_tests.cpp | 8 ++++++++ |
12 |
1 files changed, 8 insertions(+), 0 deletions(-) |
13 |
|
14 |
diff --git a/src/builtins/tests/declare_tests.cpp b/src/builtins/tests/declare_tests.cpp |
15 |
index 21657dd..4697aed 100644 |
16 |
--- a/src/builtins/tests/declare_tests.cpp |
17 |
+++ b/src/builtins/tests/declare_tests.cpp |
18 |
@@ -41,6 +41,14 @@ static void test_declare(const string& expected, std::initializer_list<string> a |
19 |
EXPECT_EQ(expected, test_output.str()); |
20 |
} |
21 |
|
22 |
+TEST(declare_builtin_test, invalid_arguments) |
23 |
+{ |
24 |
+ test_declare("Arguments required for declare\n", {}); |
25 |
+ test_declare("Multiple arguments are not supported\n", {"-ap"}); |
26 |
+ test_declare("Invalid option for declare builtin\n", {"_a"}); |
27 |
+ test_declare("Unrecognized option for declare: -L\n", {"-L"}); |
28 |
+} |
29 |
+ |
30 |
TEST(declare_builtin_test, _F) |
31 |
{ |
32 |
stringstream expression("function foo() { :; }; function bar() { :; }"); |