mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Add core.strip_escapes() (#16485)
This commit is contained in:
parent
cc6b56b034
commit
d932f34693
8 changed files with 52 additions and 17 deletions
|
@ -17,7 +17,7 @@ namespace {
|
|||
public:
|
||||
MyScriptApi() : ScriptApiBase(ScriptingType::Async) {};
|
||||
void init();
|
||||
using ScriptApiBase::getStack;
|
||||
using ScriptApiBase::getStack; // make public
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -335,6 +335,8 @@ void TestUtilities::testRemoveEscapes()
|
|||
L"abc\x1b(escaped)def") == L"abcdef");
|
||||
UASSERT(unescape_enriched<wchar_t>(
|
||||
L"abc\x1b((escaped with parenthesis\\))def") == L"abcdef");
|
||||
UASSERTEQ(auto, unescape_enriched("abc\x1b(not this\\\\)def"),
|
||||
"abcdef");
|
||||
UASSERT(unescape_enriched<wchar_t>(
|
||||
L"abc\x1b(incomplete") == L"abc");
|
||||
UASSERT(unescape_enriched<wchar_t>(
|
||||
|
@ -342,6 +344,9 @@ void TestUtilities::testRemoveEscapes()
|
|||
// Nested escapes not supported
|
||||
UASSERT(unescape_enriched<wchar_t>(
|
||||
L"abc\x1b(outer \x1b(inner escape)escape)def") == L"abcescape)def");
|
||||
// Multiple
|
||||
UASSERTEQ(auto, unescape_enriched("one\x1bX two \x1b(four)three"),
|
||||
"one two three");
|
||||
}
|
||||
|
||||
void TestUtilities::testWrapRows()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue