Changeset 199 for trunk/Test.pas


Ignore:
Timestamp:
Jan 28, 2026, 10:24:15 AM (5 hours ago)
Author:
chronos
Message:
  • Fixed: Handling escaped semicolon in indexed property values.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Test.pas

    r168 r199  
    1919  end;
    2020
    21   { TTestCaseCheckProperty }
    22 
    23   TTestCaseCheckProperty = class(TTestCase)
    24     Input: string;
     21  { TTestCasePropertyRead }
     22
     23  TTestCasePropertyRead = class(TTestCase)
     24    Input: string;
     25    ContactIndex: Integer;
     26    Index: TContactFieldIndex;
     27    Value: string;
     28    procedure Run; override;
     29  end;
     30
     31  { TTestCasePropertyWrite }
     32
     33  TTestCasePropertyWrite = class(TTestCase)
     34    Input: string;
     35    Output: string;
    2536    ContactIndex: Integer;
    2637    Index: TContactFieldIndex;
     
    140151end;
    141152
    142 { TTestCaseCheckProperty }
    143 
    144 procedure TTestCaseCheckProperty.Run;
     153{ TTestCasePropertyRead }
     154
     155procedure TTestCasePropertyRead.Run;
    145156var
    146157  Lines: TStringList;
     
    169180end;
    170181
     182{ TTestCasePropertyWrite }
     183
     184procedure TTestCasePropertyWrite.Run;
     185var
     186  Lines: TStringList;
     187begin
     188  Lines := TStringList.Create;
     189  try
     190    with TVCardFile.Create(nil) do
     191    try
     192      Lines.Text := Input;
     193      VCard.LoadFromStrings(Lines);
     194      if ContactIndex < VCard.Contacts.Count then begin
     195        VCard.Contacts[ContactIndex].Fields[Index] := Value;
     196      end else Fail;
     197      Lines.Clear;
     198      VCard.SaveToStrings(Lines);
     199      Log := SExpected + LineEnding +
     200        '"' + Output + '"' + LineEnding + LineEnding +
     201        SOutput + LineEnding +
     202        '"' + Lines.Text + '"';
     203      Evaluate(Lines.Text = Output);
     204    finally
     205      Free;
     206    end;
     207  finally
     208    Lines.Free;
     209  end;
     210end;
     211
    171212{ TTestCaseLoadSave }
    172213
Note: See TracChangeset for help on using the changeset viewer.