Changeset 7
- Timestamp:
- Aug 19, 2022, 11:04:03 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SVNZero.lpr
r6 r7 31 31 with TTestCases.Create do 32 32 try 33 AddNew('Add', TTestCaseAdd);33 { AddNew('Add', TTestCaseAdd); 34 34 AddNew('Update', TTestCaseUpdate); 35 35 AddNew('Modify', TTestCaseModify); 36 36 AddNew('Delete', TTestCaseDelete); 37 } AddNew('Merge', TTestCaseMerge); 37 38 Run; 38 39 finally -
trunk/UTest.pas
r6 r7 129 129 Passed: Integer; 130 130 Failed: Integer; 131 LastDir: string; 131 132 begin 132 133 for I := 0 to Count - 1 do 133 134 with Items[I] do begin 134 135 WriteLn('== ' + Name + ' ======= '); 136 LastDir := GetCurrentDir; 135 137 Run; 138 ChDir(LastDir); 136 139 end; 137 140 -
trunk/UTestCases.pas
r6 r7 23 23 end; 24 24 25 { TTestCaseMerge } 26 27 TTestCaseMerge = class(TTestCaseSvn) 28 procedure Run; override; 29 end; 30 25 31 26 32 implementation 33 34 { TTestCaseMerge } 35 36 procedure TTestCaseMerge.Run; 37 var 38 TestFile: string; 39 begin 40 TestFile := 'TestFile.txt'; 41 SvnAdmin(['create', RepoDir]); 42 Svn(['checkout', 'file:///' + RepoDir, WorkDir]); 43 ChDir(WorkDir); 44 SaveStringToFile('First line' + LineEnding + 'Second line' + LineEnding + 'Third line', TestFile); 45 Svn(['add', TestFile]); 46 Svn(['commit', '-m', '"Commit message"']); 47 SaveStringToFile('First line' + LineEnding + 'Second line' + LineEnding + 'Third line 2', TestFile); 48 Svn(['commit', '-m', '"Commit message 2"']); 49 Svn(['update', '-r', '1', TestFile]); 50 SaveStringToFile('First line 2' + LineEnding + 'Second line' + LineEnding + 'Third line', TestFile); 51 Svn(['update', TestFile]); 52 Svn(['commit', '-m', '"Commit message 3"']); 53 DeleteDirectory(WorkDir, False); 54 DeleteDirectory(RepoDir, False); 55 Evaluate(True); 56 end; 27 57 28 58 procedure TTestCaseAdd.Run; 29 59 var 30 60 TestFile: string; 31 LastDir: string;32 61 begin 33 TestResult := trNone;34 LastDir := GetCurrentDir;35 62 TestFile := 'TestFile.txt'; 36 63 SvnAdmin(['create', RepoDir]); … … 40 67 Svn(['add', TestFile]); 41 68 Svn(['commit', '-m', '"Commit message"']); 42 ChDir(LastDir);43 69 DeleteDirectory(WorkDir, False); 44 70 DeleteDirectory(RepoDir, False); … … 49 75 var 50 76 TestFile: string; 51 LastDir: string;52 77 begin 53 TestResult := trNone;54 LastDir := GetCurrentDir;55 78 TestFile := 'TestFile.txt'; 56 79 SvnAdmin(['create', RepoDir]); … … 62 85 SaveStringToFile('Different text', TestFile); 63 86 Svn(['commit', '-m', '"Commit message 2"']); 64 ChDir(LastDir);65 87 DeleteDirectory(WorkDir, False); 66 88 DeleteDirectory(RepoDir, False); … … 71 93 var 72 94 TestFile: string; 73 LastDir: string;74 95 begin 75 TestResult := trNone;76 LastDir := GetCurrentDir;77 96 TestFile := 'TestFile.txt'; 78 97 SvnAdmin(['create', RepoDir]); … … 86 105 Svn(['update', '-r', '1', TestFile]); 87 106 Svn(['update']); 88 ChDir(LastDir);89 107 DeleteDirectory(WorkDir, False); 90 108 DeleteDirectory(RepoDir, False); … … 95 113 var 96 114 TestFile: string; 97 LastDir: string;98 115 begin 99 TestResult := trNone;100 LastDir := GetCurrentDir;101 116 TestFile := 'TestFile.txt'; 102 117 SvnAdmin(['create', RepoDir]); … … 108 123 Svn(['delete', TestFile]); 109 124 Svn(['commit', '-m', '"Commit message 2"']); 110 ChDir(LastDir);111 125 DeleteDirectory(WorkDir, False); 112 126 DeleteDirectory(RepoDir, False);
Note:
See TracChangeset
for help on using the changeset viewer.