mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 05:19:08 +02:00
LazUtils tests: Remove unit test for UTF8CompareLatinTextFast. The whole function will be removed. Issue #40014.
This commit is contained in:
parent
99de97a21c
commit
041341dd1c
@ -32,7 +32,6 @@ type
|
||||
procedure TestUnicodeToUTF8;
|
||||
procedure TestUTF8QuotedStr;
|
||||
procedure TestUTF8FixBroken;
|
||||
procedure TestUTF8CompareLatinTextFast;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -268,30 +267,6 @@ begin
|
||||
t(#$F4#$90#$80#$80,' ');
|
||||
end;
|
||||
|
||||
procedure TTestLazUTF8.TestUTF8CompareLatinTextFast;
|
||||
var
|
||||
a, b, c: String;
|
||||
begin
|
||||
// ASCII
|
||||
AssertTrue(UTF8CompareLatinTextFast('abc', 'xyz') < 0);
|
||||
AssertTrue(UTF8CompareLatinTextFast('xyz', 'abc') > 0);
|
||||
AssertTrue(UTF8CompareLatinTextFast('ijk', 'ijk') = 0);
|
||||
// ASCII <-> non-ASCII
|
||||
AssertTrue(UTF8CompareLatinTextFast('hello', 'привет') < 0);
|
||||
AssertTrue(UTF8CompareLatinTextFast('привет', 'hello') > 0);
|
||||
// non-ASCII
|
||||
AssertTrue(UTF8CompareLatinTextFast('привет', 'नमस्ते') < 0); // 'Hello' in Sankrit
|
||||
AssertTrue(UTF8CompareLatinTextFast('नमस्ते', 'привет') > 0);
|
||||
AssertTrue(UTF8CompareLatinTextFast('привет', 'привет') = 0);
|
||||
// Issue #40014
|
||||
a := 'abcä';
|
||||
b := 'abcx';
|
||||
c := 'abc|'; // '|' comes after ['a'..'z','A'..'Z'] in ASCII table.
|
||||
AssertTrue('UTF8CompareLatinTextFast('+a+', '+b+')', UTF8CompareLatinTextFast(a, b) > 0);
|
||||
AssertTrue('UTF8CompareLatinTextFast('+a+', '+c+')', UTF8CompareLatinTextFast(a, c) > 0);
|
||||
AssertTrue('UTF8CompareLatinTextFast('+b+', '+c+')', UTF8CompareLatinTextFast(b, c) < 0);
|
||||
end;
|
||||
|
||||
initialization
|
||||
AddToLazUtilsTestSuite(TTestLazUTF8);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user