Improvements for markdown parsing.
This commit is contained in:
parent
fc44290e3f
commit
8705859115
40 changed files with 957 additions and 537 deletions
|
@ -1,5 +1,6 @@
|
|||
set(COMPILER_UNIT_TEST_FILES
|
||||
compiler/TestTemplatingEngine.cpp
|
||||
compiler/TestLexer.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
|
|
19
test/compiler/TestLexer.cpp
Normal file
19
test/compiler/TestLexer.cpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include "Lexer.h"
|
||||
|
||||
#include "TestFramework.h"
|
||||
#include "TestUtils.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
TEST_CASE(TestLexer_MatchPattern, "[compiler]")
|
||||
{
|
||||
std::string input = "[I'm inside the tag](I'm inside the brackets), followed by more text.";
|
||||
std::string pattern = "[@](@)";
|
||||
|
||||
std::vector<std::string> hits;
|
||||
const auto matched = Lexer::matchPattern(pattern, input, '@', hits);
|
||||
REQUIRE(matched);
|
||||
REQUIRE(hits.size() == 2);
|
||||
REQUIRE(hits[0] == "I'm inside the tag");
|
||||
REQUIRE(hits[1] == "I'm inside the brackets");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue