Changeset 126 for trunk/UTest.pas
- Timestamp:
- Apr 6, 2022, 11:36:27 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTest.pas
r94 r126 32 32 end; 33 33 34 TTestCaseActionKind = (akNone, akRemoveExactDuplicates); 35 34 36 { TTestCaseLoadSave } 35 37 … … 37 39 Input: string; 38 40 Output: string; 41 Action: TTestCaseActionKind; 39 42 procedure Run; override; 40 43 end; … … 50 53 end; 51 54 55 resourcestring 56 SNone = 'None'; 57 SPassed = 'Passed'; 58 SFailed = 'Failed'; 59 52 60 const 53 ResultText: array[TTestResult] of string = ('None', 'Passed', 'Failed'); 61 ResultText: array[TTestResult] of string = (SNone, SPassed, SFailed); 62 63 procedure Translate; 54 64 55 65 56 66 implementation 67 68 resourcestring 69 SExpected = 'Expected:'; 70 SOutput = 'Output:'; 71 72 procedure Translate; 73 begin 74 ResultText[trNone] := SNone; 75 ResultText[trPassed] := SPassed; 76 ResultText[trFailed] := SFailed; 77 end; 57 78 58 79 { TTestCaseCheckProperty } … … 73 94 Evaluate(PropertyValue = Value); 74 95 end else Fail; 75 Log := 'Expected:'+ LineEnding +96 Log := SExpected + LineEnding + 76 97 '"' + Value + '"' + LineEnding + LineEnding + 77 'Output:'+ LineEnding +98 SOutput + LineEnding + 78 99 '"' + PropertyValue + '"'; 79 100 finally … … 97 118 Lines.Text := Input; 98 119 LoadFromStrings(Lines); 120 121 if Action = akRemoveExactDuplicates then 122 Contacts.RemoveExactDuplicates; 123 99 124 Lines.Text := ''; 100 125 SaveToStrings(Lines); 101 126 Evaluate(Lines.Text = Output); 102 Log := 'Expected:'+ LineEnding +127 Log := SExpected + LineEnding + 103 128 '"' + Output + '"' + LineEnding + LineEnding + 104 'Output:'+ LineEnding +129 SOutput + LineEnding + 105 130 '"' + Lines.Text + '"'; 106 131 finally
Note:
See TracChangeset
for help on using the changeset viewer.