mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 08:47:59 +02:00
Starts utf-8 test for LazUtils
git-svn-id: trunk@32733 -
This commit is contained in:
parent
0d3e467911
commit
72be8c7edb
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -5968,6 +5968,8 @@ test/codetoolstests/testcth2pas.pas svneol=native#text/pascal
|
||||
test/codetoolstests/testctrangescan.pas svneol=native#text/plain
|
||||
test/codetoolstests/testctxmlfixfragments.pas svneol=native#text/pascal
|
||||
test/hello.ahk svneol=native#text/plain
|
||||
test/lazutils/testunicode.lpi svneol=native#text/plain
|
||||
test/lazutils/testunicode.pas svneol=native#text/pascal
|
||||
test/lcltests/testmethodcompare.pas svneol=native#text/plain
|
||||
test/lcltests/testpen.pas svneol=native#text/plain
|
||||
test/lcltests/testpreferredsize.pas svneol=native#text/plain
|
||||
|
83
test/lazutils/testunicode.lpi
Normal file
83
test/lazutils/testunicode.lpi
Normal file
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
<UseDefaultCompilerOptions Value="True"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<LaunchingApplication PathPlusParams="/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LazUtils"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<Filename Value="testunicode.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestUnicode"/>
|
||||
</Unit0>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="10"/>
|
||||
<Target>
|
||||
<Filename Value="testunicode"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsAuto"/>
|
||||
</Debugging>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerMessages>
|
||||
<UseMsgFile Value="True"/>
|
||||
</CompilerMessages>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
20
test/lazutils/testunicode.pas
Normal file
20
test/lazutils/testunicode.pas
Normal file
@ -0,0 +1,20 @@
|
||||
program TestUnicode;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
lazutf8;
|
||||
|
||||
procedure AssertStringOperation(AMsg, AStr1, AStr2, AStrExpected2: utf8string);
|
||||
begin
|
||||
Write(AMsg, ' ', AStr1, ' => ', AStr2, ' Expected ', AStrExpected2);
|
||||
if UTF8CompareStr(AStr1, AStr2) <> 0 then Write(' !Error!');
|
||||
WriteLn();
|
||||
end;
|
||||
|
||||
begin
|
||||
// Turkish
|
||||
AssertStringOperation('Turkish UTF8UpperCase 1', 'abcçdefgğhıijklmnoöprsştuüvyz', UTF8UpperCase('abcçdefgğhıijklmnoöprsştuüvyz'), 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ');
|
||||
AssertStringOperation('Turkish UTF8UpperCase 2', 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ', UTF8UpperCase('ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ'), 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ');
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user