Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
12aac746
Commit
12aac746
authored
Nov 19, 2012
by
Michal 'vorner' Vaner
Browse files
[2375] Check an unbalanced parenthesis is detected
parent
be89b811
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/tests/master_lexer_unittest.cc
View file @
12aac746
...
...
@@ -270,6 +270,19 @@ TEST_F(MasterLexerTest, eof) {
EXPECT_THROW
(
lexer
.
getNextToken
(),
isc
::
InvalidOperation
);
}
// Check we properly return error when there's an opened parentheses and no
// closing one
TEST_F
(
MasterLexerTest
,
getUnbalanced
)
{
ss
<<
"(
\"
string
\"
"
;
lexer
.
pushSource
(
ss
);
// The string gets out first
EXPECT_EQ
(
MasterLexer
::
Token
::
STRING
,
lexer
.
getNextToken
().
getType
());
// Then an unbalanced parethsis
EXPECT_EQ
(
MasterLexer
::
Token
::
UNBALANCED_PAREN
,
lexer
.
getNextToken
().
getErrorCode
());
}
void
checkInput
(
const
std
::
string
&
expected
,
const
std
::
string
&
received
)
{
EXPECT_EQ
(
expected
,
received
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment