Changeset 237
- Timestamp:
- Jun 29, 2023, 11:15:54 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Tests.pas
r236 r237 185 185 Source.Add('end.'); 186 186 ExpectedOutput := '10' + LineEnding; 187 end; 188 with TTestRun(Result.AddNew('function var', TTestRun)) do begin 189 Source.Add('function Test(A: string): string;'); 190 Source.Add('var'); 191 Source.Add(' C: string;'); 192 Source.Add('begin'); 193 Source.Add(' C := A;'); 194 Source.Add(' Result := C;'); 195 Source.Add('end;'); 196 Source.Add(''); 197 Source.Add('begin'); 198 Source.Add(' WriteLn(Test(''X''));'); 199 Source.Add('end.'); 200 ExpectedOutput := 'X' + LineEnding; 201 end; 202 with TTestRun(Result.AddNew('function const', TTestRun)) do begin 203 Source.Add('function Test: string;'); 204 Source.Add('const'); 205 Source.Add(' D: string = ''X'';'); 206 Source.Add('begin'); 207 Source.Add(' Result := D;'); 208 Source.Add('end;'); 209 Source.Add(''); 210 Source.Add('begin'); 211 Source.Add(' WriteLn(Test);'); 212 Source.Add('end.'); 213 ExpectedOutput := 'X' + LineEnding; 187 214 end; 188 215 with TTestRun(Result.AddNew('procedure', TTestRun)) do begin
Note:
See TracChangeset
for help on using the changeset viewer.