Document and test Token::concatStr()
This commit is contained in:
parent
5b97cc1440
commit
1ccb57e595
|
@ -48,6 +48,10 @@ public:
|
|||
|
||||
void str(const std::string &s);
|
||||
|
||||
/**
|
||||
* Concatenate two strings. "hello" "world" -> "hello world"
|
||||
* Note: Automatically cuts of the last/first character.
|
||||
*/
|
||||
void concatStr(std::string const& b);
|
||||
|
||||
const std::string &str() const {
|
||||
|
|
|
@ -48,6 +48,7 @@ private:
|
|||
TEST_CASE(matchOr);
|
||||
|
||||
TEST_CASE(updateProperties)
|
||||
TEST_CASE(updatePropertiesConcatStr)
|
||||
TEST_CASE(isNameGuarantees1)
|
||||
TEST_CASE(isNameGuarantees2)
|
||||
TEST_CASE(isNameGuarantees3)
|
||||
|
@ -274,6 +275,18 @@ private:
|
|||
ASSERT_EQUALS(true, tok.isNumber());
|
||||
}
|
||||
|
||||
void updatePropertiesConcatStr() {
|
||||
Token tok(NULL);
|
||||
tok.str("true");
|
||||
|
||||
ASSERT_EQUALS(true, tok.isBoolean());
|
||||
|
||||
tok.concatStr("123");
|
||||
|
||||
ASSERT_EQUALS(false, tok.isBoolean());
|
||||
ASSERT_EQUALS("tru23", tok.str());
|
||||
}
|
||||
|
||||
void isNameGuarantees1() {
|
||||
Token tok(NULL);
|
||||
tok.str("Name");
|
||||
|
|
Loading…
Reference in New Issue