fpc/tests/webtbs/tw15500.pp
micha e66b0b1f37 * tests: add test for issue #15500
git-svn-id: trunk@14720 -
2010-01-17 15:57:05 +00:00

41 lines
704 B
ObjectPascal

{$mode objfpc}{$H+}
uses
SysUtils, fgl;
type
TMap = specialize TFPGMap<String, String>;
var
map: TMap;
const
strings: array[0..4] of string =
('BaseDir', 'OutputDir', 'ModelName', 'Unit', 'SimSoftware');
var
i, j: integer;
begin
map := TMap.Create;
map.Sorted := True;
for i := low(strings) to high(strings) do
map.add(strings[i], inttostr(i));
for i := low(strings) to high(strings) do
begin
if not map.Find(strings[i], j) then
begin
writeln('not found: "', strings[i], '"');
halt(1);
end;
if map.data[j] <> inttostr(i) then
begin
writeln('not matched: ', map.data[j], ' <> ', i);
halt(1);
end;
end;
map.Free;
end.