diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-12-16 13:08:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 13:08:53 +0100 |
commit | 91c05290738aae5662a76f59dd3e4ccfdf5e37ae (patch) | |
tree | e4f160dc06201fb3a839ddb14ce9816014369498 /tests/core/string/test_string.h | |
parent | 6435d1be232e45b3729a69a0c21f0f735166914a (diff) | |
parent | e4e4e475f8f1a1d8b82ef7ad636da8536e8c6554 (diff) | |
download | redot-engine-91c05290738aae5662a76f59dd3e4ccfdf5e37ae.tar.gz |
Merge pull request #55930 from timothyqiu/doctool-i18n
Diffstat (limited to 'tests/core/string/test_string.h')
-rw-r--r-- | tests/core/string/test_string.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index eef1cac894..bb9b079e79 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -1132,6 +1132,25 @@ TEST_CASE("[String] c-escape/unescape") { CHECK(s.c_escape().c_unescape() == s); } +TEST_CASE("[String] indent") { + static const char *input[] = { + "", + "aaa\nbbb", + "\tcontains\n\tindent", + "empty\n\nline", + }; + static const char *expected[] = { + "", + "\taaa\n\tbbb", + "\t\tcontains\n\t\tindent", + "\tempty\n\n\tline", + }; + + for (int i = 0; i < 3; i++) { + CHECK(String(input[i]).indent("\t") == expected[i]); + } +} + TEST_CASE("[String] dedent") { String s = " aaa\n bbb"; String t = "aaa\nbbb"; |