fpc/tests/test/jvm/sort.pp
Jonas Maebe 71068ae7eb * made the tests Android-compatible (use the androidr14 unit instead
of the jdk15 unit in that case)
  * adjusted testall.sh script so it can also be used to test class
    files compiled for Android (still with the JVM though)

git-svn-id: branches/jvmbackend@19835 -
2011-12-12 20:34:02 +00:00

32 lines
572 B
ObjectPascal

program sort;
{$mode delphi}
{$modeswitch unicodestrings}
uses
{$ifdef java}jdk15{$else}androidr14{$endif};
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.