|
|
@ -531,7 +531,7 @@ protected static function Test_AppendStringGet() |
|
|
|
defaultTag = __().color.GetColorTagRGB(1, 1, 1); |
|
|
|
defaultTag = __().color.GetColorTagRGB(1, 1, 1); |
|
|
|
colorTag = __().color.GetColorTag(testColor); |
|
|
|
colorTag = __().color.GetColorTag(testColor); |
|
|
|
greenTag = __().color.GetColorTagRGB(0, 255, 0); |
|
|
|
greenTag = __().color.GetColorTagRGB(0, 255, 0); |
|
|
|
txt.AppendPlainString("Prepare to "); |
|
|
|
txt.AppendString("Prepare to "); |
|
|
|
txt.AppendColoredString(colorTag $ "DIE"); |
|
|
|
txt.AppendColoredString(colorTag $ "DIE"); |
|
|
|
txt.AppendFormattedString(" and be {#00ff00 reborn}!"); |
|
|
|
txt.AppendFormattedString(" and be {#00ff00 reborn}!"); |
|
|
|
TEST_ExpectTrue( txt.ToString() |
|
|
|
TEST_ExpectTrue( txt.ToString() |
|
|
@ -901,7 +901,7 @@ protected static function SubTest_ReplaceEdgeCases(Text.FormatSensitivity flag) |
|
|
|
TEST_ExpectTrue(builder.Replace(P(""), P(""),, flag).ToString() == ""); |
|
|
|
TEST_ExpectTrue(builder.Replace(P(""), P(""),, flag).ToString() == ""); |
|
|
|
TEST_ExpectTrue( |
|
|
|
TEST_ExpectTrue( |
|
|
|
builder.Replace(P(""), P("huh"),, flag).ToString() == ""); |
|
|
|
builder.Replace(P(""), P("huh"),, flag).ToString() == ""); |
|
|
|
builder.AppendPlainString("word"); |
|
|
|
builder.AppendString("word"); |
|
|
|
TEST_ExpectTrue( |
|
|
|
TEST_ExpectTrue( |
|
|
|
builder.Replace(P(""), P(""),, flag).ToString() == "word"); |
|
|
|
builder.Replace(P(""), P(""),, flag).ToString() == "word"); |
|
|
|
TEST_ExpectTrue( |
|
|
|
TEST_ExpectTrue( |
|
|
@ -919,7 +919,7 @@ protected static function SubTest_ReplaceEdgeCases(Text.FormatSensitivity flag) |
|
|
|
.Replace(F("Just {#54af4c something}"), P("Nothing really"),, flag) |
|
|
|
.Replace(F("Just {#54af4c something}"), P("Nothing really"),, flag) |
|
|
|
.ToString() |
|
|
|
.ToString() |
|
|
|
== "Nothing really"); |
|
|
|
== "Nothing really"); |
|
|
|
TEST_ExpectTrue(builder.Clear().AppendPlainString("CraZy") |
|
|
|
TEST_ExpectTrue(builder.Clear().AppendString("CraZy") |
|
|
|
.Replace(P("CRaZy"), P("calm"), SCASE_INSENSITIVE, flag) |
|
|
|
.Replace(P("CRaZy"), P("calm"), SCASE_INSENSITIVE, flag) |
|
|
|
.ToString() |
|
|
|
.ToString() |
|
|
|
== "calm"); |
|
|
|
== "calm"); |
|
|
@ -940,17 +940,17 @@ protected static function SubTest_ReplaceMainCases(Text.FormatSensitivity flag) |
|
|
|
== "Mate eight said"); |
|
|
|
== "Mate eight said"); |
|
|
|
|
|
|
|
|
|
|
|
Issue("`Replace()` replaces sub-`Text` incorrectly."); |
|
|
|
Issue("`Replace()` replaces sub-`Text` incorrectly."); |
|
|
|
builder.Clear().AppendPlainString("Do it bay bee"); |
|
|
|
builder.Clear().AppendString("Do it bay bee"); |
|
|
|
TEST_ExpectTrue(builder.Replace(P("it"), P("this"),, flag).ToString() |
|
|
|
TEST_ExpectTrue(builder.Replace(P("it"), P("this"),, flag).ToString() |
|
|
|
== "Do this bay bee"); |
|
|
|
== "Do this bay bee"); |
|
|
|
builder.Clear().AppendPlainString("dO It bAy BEe"); |
|
|
|
builder.Clear().AppendString("dO It bAy BEe"); |
|
|
|
TEST_ExpectTrue( |
|
|
|
TEST_ExpectTrue( |
|
|
|
builder.Replace(P("it"), P("tHis"), SCASE_INSENSITIVE, flag) |
|
|
|
builder.Replace(P("it"), P("tHis"), SCASE_INSENSITIVE, flag) |
|
|
|
.ToString() |
|
|
|
.ToString() |
|
|
|
== "dO tHis bAy BEe"); |
|
|
|
== "dO tHis bAy BEe"); |
|
|
|
|
|
|
|
|
|
|
|
Issue("`Replace()` replaces sub-`Text` incorrectly."); |
|
|
|
Issue("`Replace()` replaces sub-`Text` incorrectly."); |
|
|
|
builder.Clear().AppendPlainString("he and she and it"); |
|
|
|
builder.Clear().AppendString("he and she and it"); |
|
|
|
TEST_ExpectTrue(builder.Replace(P("and"), P("OR"),, flag) |
|
|
|
TEST_ExpectTrue(builder.Replace(P("and"), P("OR"),, flag) |
|
|
|
.ToString() |
|
|
|
.ToString() |
|
|
|
== "he OR she OR it"); |
|
|
|
== "he OR she OR it"); |
|
|
|