Browse Source

* tests: add test for issue #15500

git-svn-id: trunk@14720 -
micha 15 years ago
parent
commit
e66b0b1f37
2 changed files with 41 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 40 0
      tests/webtbs/tw15500.pp

+ 1 - 0
.gitattributes

@@ -10223,6 +10223,7 @@ tests/webtbs/tw15415.pp svneol=native#text/plain
 tests/webtbs/tw15446.pp svneol=native#text/plain
 tests/webtbs/tw15453a.pp svneol=native#text/plain
 tests/webtbs/tw15467.pp svneol=native#text/pascal
+tests/webtbs/tw15500.pp svneol=native#text/plain
 tests/webtbs/tw15504.pp svneol=native#text/plain
 tests/webtbs/tw15530.pp svneol=native#text/pascal
 tests/webtbs/tw1567.pp svneol=native#text/plain

+ 40 - 0
tests/webtbs/tw15500.pp

@@ -0,0 +1,40 @@
+{$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.
+