fpc/tests/test/jvm/sort.pp
Jonas Maebe 740e7ca6b5 + a bunch of jvm-specific tests: partly new, partly derived from existing
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 -
2011-08-20 08:35:11 +00:00

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.