* [gentoo-commits] proj/libbash:master commit in: src/core/tests/
@ 2011-05-27 23:03 Petteri Räty
0 siblings, 0 replies; 3+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
To: gentoo-commits
commit: 12e8d998d0f388ff0d9b3440eb0e70a5e9eb5859
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 14:54:17 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 26 14:55:59 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=12e8d998
Test: improve test coverage for bash_ast.cpp
---
src/core/tests/bash_ast_test.cpp | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/core/tests/bash_ast_test.cpp b/src/core/tests/bash_ast_test.cpp
index d5061ca..b2376fb 100644
--- a/src/core/tests/bash_ast_test.cpp
+++ b/src/core/tests/bash_ast_test.cpp
@@ -54,3 +54,8 @@ TEST(bash_ast, parse_arithmetics)
interpreter walker;
EXPECT_EQ(3, ast.interpret_with(walker, &bash_ast::walker_arithmetics));
}
+
+TEST(bash_ast, illegal_path)
+{
+ EXPECT_THROW(bash_ast("not_exist"), interpreter_exception);
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: src/core/tests/
@ 2011-05-27 23:03 Petteri Räty
0 siblings, 0 replies; 3+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
To: gentoo-commits
commit: ba0032a7f8fadc05103acfc823f660e03913c9d6
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 14:59:12 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 26 14:56:16 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=ba0032a7
Test: improve test coverage for bash_condition.cpp
---
src/core/tests/bash_condition_test.cpp | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/core/tests/bash_condition_test.cpp b/src/core/tests/bash_condition_test.cpp
index 57ab4e9..de56fee 100644
--- a/src/core/tests/bash_condition_test.cpp
+++ b/src/core/tests/bash_condition_test.cpp
@@ -151,6 +151,9 @@ TEST_F(file_test, binary_operator)
EXPECT_TRUE(internal::test_binary("ef", positive, positive));
EXPECT_FALSE(internal::test_binary("ef", positive, negative));
+ EXPECT_FALSE(internal::test_binary("ef", "not exist", negative));
+
+ EXPECT_THROW(internal::test_binary("efd", positive, negative), interpreter_exception);
}
TEST(bash_condition, arithmetic_operator)
@@ -176,4 +179,6 @@ TEST(bash_condition, arithmetic_operator)
EXPECT_TRUE(internal::test_binary("ge", "1", "1"));
EXPECT_TRUE(internal::test_binary("ge", "2", "1"));
EXPECT_FALSE(internal::test_binary("ge", "0", "1"));
+
+ EXPECT_FALSE(internal::test_binary("ge", "blah", "1"));
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] proj/libbash:master commit in: src/core/tests/
@ 2011-05-27 23:03 Petteri Räty
0 siblings, 0 replies; 3+ messages in thread
From: Petteri Räty @ 2011-05-27 23:03 UTC (permalink / raw
To: gentoo-commits
commit: 0a222ac2bce195a1bb162b93ba81c798cc1080d1
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 15:11:43 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu May 26 14:56:30 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=0a222ac2
Test: improve test coverage for interpreter.cpp
---
src/core/tests/interpreter_test.cpp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/core/tests/interpreter_test.cpp b/src/core/tests/interpreter_test.cpp
index 0322a6b..d5e5d4a 100644
--- a/src/core/tests/interpreter_test.cpp
+++ b/src/core/tests/interpreter_test.cpp
@@ -59,6 +59,8 @@ TEST(interpreter, define_resolve_array)
walker.define("partial", 10, false, 8);
EXPECT_EQ(1, walker.get_array_length("partial"));
EXPECT_EQ(10, walker.resolve<int>("partial", 8));
+
+ EXPECT_EQ(0, walker.get_array_length("not exist"));
}
TEST(interpreter, is_unset_or_null)
@@ -172,9 +174,10 @@ TEST(interpreter, unset_values)
EXPECT_THROW(walker.unset("ro_var"), interpreter_exception);
}
-TEST(interperter, substring_expansion_exception)
+TEST(interperter, substring_expansion)
{
interpreter walker;
+ EXPECT_STREQ("", walker.do_substring_expansion("@", 0, 1, 2).c_str());
EXPECT_THROW(walker.do_substring_expansion("", 0, -1, 0), interpreter_exception);
}
@@ -203,3 +206,11 @@ TEST(interpreter, bash_option)
walker.set_option("extglob", true);
EXPECT_TRUE(walker.get_option("extglob"));
}
+
+TEST(interpreter, call_function)
+{
+ interpreter walker;
+ std::vector<std::string> arguments;
+
+ EXPECT_EQ(-1, walker.call("not exist", arguments, 0, 0));
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-27 23:04 UTC | newest]
Thread overview: 3+ 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/core/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox