aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-07 09:27:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-07 09:27:40 +0000
commit88ee077461270d51a5f87d5fb9c74831dcc1be23 (patch)
treebb8fa691b8be680ab953b92b6507fc00366ac530
parent1eff1e91b30f895300dc14ded7869ac0b6700bc5 (diff)
downloadpaludis-88ee077461270d51a5f87d5fb9c74831dcc1be23.tar.gz
paludis-88ee077461270d51a5f87d5fb9c74831dcc1be23.tar.xz
Improve dep lexer test coverage
-rw-r--r--paludis/dep_lexer_TEST.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/paludis/dep_lexer_TEST.cc b/paludis/dep_lexer_TEST.cc
index 7cb220b..f99c964 100644
--- a/paludis/dep_lexer_TEST.cc
+++ b/paludis/dep_lexer_TEST.cc
@@ -227,6 +227,24 @@ namespace test_cases
TEST_CHECK(++i == l.end());
}
} test_dep_atom_parser_lexer_use;
+
+ /**
+ * \test Test DepLexer with bad input.
+ *
+ * \ingroup Test
+ */
+ struct DepLexerBadTest : TestCase
+ {
+ DepLexerBadTest() : TestCase("bad") { }
+
+ void run()
+ {
+ TEST_CHECK_THROWS(DepLexer("(moo)"), DepStringError);
+ TEST_CHECK_THROWS(DepLexer("|foo"), DepStringError);
+ TEST_CHECK_THROWS(DepLexer("( moo )bar"), DepStringError);
+ }
+ } test_dep_atom_parser_lexer_bad;
+
}