mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 09:59:27 +02:00

tests o currently not yet integrated in the makefile system, use testall.sh/ testall.bat to run the tests git-svn-id: branches/jvmbackend@18777 -
31 lines
505 B
ObjectPascal
31 lines
505 B
ObjectPascal
program sort;
|
|
|
|
{$mode delphi}
|
|
|
|
uses
|
|
jdk15;
|
|
|
|
function test : string;
|
|
var
|
|
sa : array of JLObject;
|
|
L : JUList;
|
|
i : integer;
|
|
begin
|
|
SetLength(sa, 3);
|
|
sa[0] := JLString(string('2'));
|
|
sa[1] := JLString(string('3'));
|
|
sa[2] := JLString(string('1'));
|
|
L := JUArrays.asList(sa);
|
|
JUCollections.sort(L);
|
|
|
|
Result := '';
|
|
for i := 0 to L.size() - 1 do
|
|
Result := Result + string(L.get(i)) + string(' ');
|
|
end;
|
|
|
|
begin
|
|
jlsystem.fout.println(test);
|
|
if test<>'1 2 3 ' then
|
|
raise JLException.create;
|
|
end.
|