-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See #34.
- Loading branch information
Showing
14 changed files
with
817 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
!include/**/ | ||
!source/ | ||
!source/**/ | ||
!test/ | ||
!test/**/ | ||
|
||
!*.* | ||
*~/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef TURBO_TEST_H | ||
#define TURBO_TEST_H | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <turbo/scintilla/internals.h> | ||
#include <turbo/scintilla.h> | ||
|
||
namespace turbo | ||
{ | ||
|
||
template <class T> | ||
struct TestCase | ||
{ | ||
T input; | ||
T result; | ||
}; | ||
|
||
template <class T1, class T2> | ||
inline void expectMatchingResult(const T1 &actual, const TestCase<T2> &testCase) | ||
{ | ||
EXPECT_EQ(actual, testCase.result) << "With test input:\n" << testCase.input; | ||
} | ||
|
||
struct TextState | ||
{ | ||
enum : char { | ||
chCaret = '|', | ||
chAnchor = '^', | ||
}; | ||
|
||
std::string text; | ||
Sci::Position caret {-1}; | ||
Sci::Position anchor {-1}; | ||
|
||
static TextState decode(std::string_view); | ||
static std::string encode(TextState); | ||
}; | ||
|
||
TScintilla &createScintilla(TextState state); | ||
TextState getTextState(TScintilla &scintilla); | ||
|
||
} // namespace turbo | ||
|
||
#endif // TURBO_TEST_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.