Changeset 199 for trunk/TestCases.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/TestCases.pas

    r169 r199  
    105105      Output := '';
    106106    end;
    107     with TTestCaseCheckProperty(AddNew('Property FN', TTestCaseCheckProperty)) do begin
     107    with TTestCasePropertyRead(AddNew('Property FN', TTestCasePropertyRead)) do begin
    108108      Index := cfFullName;
    109109      Value := 'Name Surname';
    110110      Input := BeginEnd('FN:' + Value + VCardLineEnding);
    111111    end;
    112     with TTestCaseCheckProperty(AddNew('Escaped new lines in text', TTestCaseCheckProperty)) do begin
     112    with TTestCasePropertyRead(AddNew('Escaped new lines in text', TTestCasePropertyRead)) do begin
    113113      Index := cfNote;
    114114      Value := 'Line' + #13#10 + 'Line';
    115115      Input := BeginEnd('NOTE:Line\nLine' + VCardLineEnding);
    116116    end;
    117     with TTestCaseCheckProperty(AddNew('Compound value', TTestCaseCheckProperty)) do begin
     117    with TTestCasePropertyRead(AddNew('Compound value', TTestCasePropertyRead)) do begin
    118118      Index := cfFirstName;
    119119      Value := 'FirstName';
    120120      Input := BeginEnd('N:Surname;FirstName;;;' + VCardLineEnding);
    121121    end;
    122     with TTestCaseCheckProperty(AddNew('Quoted-printable special symbols', TTestCaseCheckProperty)) do begin
     122    with TTestCasePropertyRead(AddNew('Escaped semicolon in name get 0', TTestCasePropertyRead)) do begin
     123      Index := cfLastName;
     124      Value := 'Surname;Surname';
     125      Input := BeginEnd('N:Surname\;Surname;Name\;Name' + VCardLineEnding);
     126    end;
     127    with TTestCasePropertyRead(AddNew('Escaped semicolon in name get 1', TTestCasePropertyRead)) do begin
     128      Index := cfFirstName;
     129      Value := 'Name;Name';
     130      Input := BeginEnd('N:Surname\;Surname;Name\;Name' + VCardLineEnding);
     131    end;
     132    with TTestCasePropertyRead(AddNew('Escaped semicolon in name get 2', TTestCasePropertyRead)) do begin
     133      Index := cfMiddleName;
     134      Value := '';
     135      Input := BeginEnd('N:Surname\;Surname;Name\;Name' + VCardLineEnding);
     136    end;
     137    with TTestCasePropertyWrite(AddNew('Escaped semicolon in name set 0', TTestCasePropertyWrite)) do begin
     138      Input := BeginEnd('N:Surname\;Surname;Name\;Name' + VCardLineEnding);
     139      Index := cfLastName;
     140      Value := 'Surname2;Surname2';
     141      Output := BeginEnd('N:Surname2\;Surname2;Name\;Name' + VCardLineEnding);
     142    end;
     143    with TTestCasePropertyWrite(AddNew('Escaped semicolon in name set 1', TTestCasePropertyWrite)) do begin
     144      Input := BeginEnd('N:Surname\;Surname;Name\;Name' + VCardLineEnding);
     145      Index := cfFirstName;
     146      Value := 'Name2;Name2';
     147      Output := BeginEnd('N:Surname\;Surname;Name2\;Name2' + VCardLineEnding);
     148    end;
     149    with TTestCasePropertyWrite(AddNew('Escaped semicolon in name set 2', TTestCasePropertyWrite)) do begin
     150      Input := BeginEnd('N:Surname\;Surname;Name\;Name' + VCardLineEnding);
     151      Index := cfMiddleName;
     152      Value := 'Middle2;Middle2';
     153      Output := BeginEnd('N:Surname\;Surname;Name\;Name;Middle2\;Middle2' + VCardLineEnding);
     154    end;
     155    with TTestCasePropertyRead(AddNew('Quoted-printable special symbols', TTestCasePropertyRead)) do begin
    123156      Index := cfFullName;
    124157      Value := 'Jméno Příjmení';
     
    126159        'FN;ENCODING=QUOTED-PRINTABLE:Jm=C3=A9no=20P=C5=99=C3=ADjmen=C3=AD' + VCardLineEnding);
    127160    end;
    128     with TTestCaseCheckProperty(AddNew('Base64 special symbols', TTestCaseCheckProperty)) do begin
     161    with TTestCasePropertyRead(AddNew('Base64 special symbols', TTestCasePropertyRead)) do begin
    129162      Index := cfFullName;
    130163      Value := 'Jméno Příjmení';
Note: See TracChangeset for help on using the changeset viewer.