* [gentoo-commits] proj/libbash:master commit in: src/builtins/tests/
@ 2011-05-27 23:03 Petteri Räty
0 siblings, 0 replies; 4+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
To: gentoo-commits
commit: 23eac61e428c4b5409cb5845c4e760be1574e2e2
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 08:35:29 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 26 14:56:41 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=23eac61e
Test: improve test coverage for return built-in
---
src/builtins/tests/return_tests.cpp | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/builtins/tests/return_tests.cpp b/src/builtins/tests/return_tests.cpp
index 23e147a..736e651 100644
--- a/src/builtins/tests/return_tests.cpp
+++ b/src/builtins/tests/return_tests.cpp
@@ -33,6 +33,7 @@ TEST(return_builtin_test, bad_argument)
{
interpreter walker;
EXPECT_THROW(cppbash_builtin::exec("return", {"abc"}, std::cout, std::cerr, std::cin, walker), boost::bad_lexical_cast);
+ EXPECT_THROW(cppbash_builtin::exec("return", {"abc", "def"}, std::cout, std::cerr, std::cin, walker), interpreter_exception);
}
TEST(return_builtin_test, bad_location)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: src/builtins/tests/
@ 2011-05-27 23:03 Petteri Räty
0 siblings, 0 replies; 4+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
To: gentoo-commits
commit: 54caee591483d714686031e8611e6fc564611760
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 08:33:22 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 26 14:56:37 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=54caee59
Test: improve test coverage for declare built-in
---
src/builtins/tests/declare_tests.cpp | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/builtins/tests/declare_tests.cpp b/src/builtins/tests/declare_tests.cpp
index 21657dd..4697aed 100644
--- a/src/builtins/tests/declare_tests.cpp
+++ b/src/builtins/tests/declare_tests.cpp
@@ -41,6 +41,14 @@ static void test_declare(const string& expected, std::initializer_list<string> a
EXPECT_EQ(expected, test_output.str());
}
+TEST(declare_builtin_test, invalid_arguments)
+{
+ test_declare("Arguments required for declare\n", {});
+ test_declare("Multiple arguments are not supported\n", {"-ap"});
+ test_declare("Invalid option for declare builtin\n", {"_a"});
+ test_declare("Unrecognized option for declare: -L\n", {"-L"});
+}
+
TEST(declare_builtin_test, _F)
{
stringstream expression("function foo() { :; }; function bar() { :; }");
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: src/builtins/tests/
@ 2011-05-27 23:03 Petteri Räty
0 siblings, 0 replies; 4+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
To: gentoo-commits
commit: ea0497dffc5d63c002ca239aaf815426fbc40fc8
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 08:44:26 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 26 14:56:49 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=ea0497df
Test: improve test coverage for shopt built-in
---
src/builtins/tests/shopt_tests.cpp | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/builtins/tests/shopt_tests.cpp b/src/builtins/tests/shopt_tests.cpp
index 14b99d0..e8cd013 100644
--- a/src/builtins/tests/shopt_tests.cpp
+++ b/src/builtins/tests/shopt_tests.cpp
@@ -46,3 +46,19 @@ TEST(shopt_builtin_test, enable_extglob)
EXPECT_TRUE(walker.get_option("autocd"));
EXPECT_TRUE(walker.get_option("cdspell"));
}
+
+static void test_shopt_builtin(const std::string& expected, const std::vector<std::string>& args, int status)
+{
+ std::stringstream output;
+ interpreter walker;
+ EXPECT_EQ(status, cppbash_builtin::exec("shopt", args, std::cout, output, std::cin, walker));
+ EXPECT_STREQ(expected.c_str(), output.str().c_str());
+}
+
+TEST(shopt_builtin_test, invalid_argument)
+{
+ test_shopt_builtin("Arguments required for shopt\n", {}, 1);
+ test_shopt_builtin("Multiple arguments are not supported\n", {"-so"}, 1);
+ test_shopt_builtin("shopt -q is not supported yet\n", {"-q"}, 1);
+ test_shopt_builtin("Unrecognized option for shopt: -d\n", {"-d"}, 1);
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: src/builtins/tests/
@ 2011-05-27 23:03 Petteri Räty
0 siblings, 0 replies; 4+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
To: gentoo-commits
commit: d5ece28caf03f95b9b306502e732f08194110baf
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 08:47:51 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 26 14:56:45 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=d5ece28c
Test: correct the test case names for shopt
---
src/builtins/tests/shopt_tests.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/builtins/tests/shopt_tests.cpp b/src/builtins/tests/shopt_tests.cpp
index 434555b..14b99d0 100644
--- a/src/builtins/tests/shopt_tests.cpp
+++ b/src/builtins/tests/shopt_tests.cpp
@@ -26,7 +26,7 @@
#include "core/interpreter.h"
#include "cppbash_builtin.h"
-TEST(return_builtin_test, disable_extglob)
+TEST(shopt_builtin_test, disable_extglob)
{
interpreter walker;
EXPECT_EQ(1, cppbash_builtin::exec("shopt", {"-u", "not exist"}, std::cout, std::cerr, std::cin, walker));
@@ -37,7 +37,7 @@ TEST(return_builtin_test, disable_extglob)
EXPECT_FALSE(walker.get_option("cdspell"));
}
-TEST(return_builtin_test, enable_extglob)
+TEST(shopt_builtin_test, enable_extglob)
{
interpreter walker;
EXPECT_EQ(1, cppbash_builtin::exec("shopt", {"-s", "not exist"}, std::cout, std::cerr, std::cin, walker));
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-05-27 23:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 23:03 [gentoo-commits] proj/libbash:master commit in: src/builtins/tests/ Petteri Räty
-- strict thread matches above, loose matches on Subject: below --
2011-05-27 23:03 Petteri Räty
2011-05-27 23:03 Petteri Räty
2011-05-27 23:03 Petteri Räty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox