author | vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177 |
Thu, 15 Nov 2012 10:26:04 +0000 | |
changeset 55 | 30d72a8f4501 |
parent 54 | 66045198bfbc |
child 69 | 17045d49309f |
permissions | -rw-r--r-- |
34 | 1 |
"{ Package: 'stx:libscm/mercurial' }" |
2 |
||
3 |
TestCase subclass:#HGTests |
|
4 |
instanceVariableNames:'repositories' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'SCM-Mercurial-Core-Tests' |
|
8 |
! |
|
9 |
||
10 |
||
11 |
!HGTests class methodsFor:'accessing'! |
|
12 |
||
13 |
resources |
|
14 |
^Array with: HGRepositoriesResource |
|
15 |
||
16 |
"Created: / 19-09-2012 / 18:55:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17 |
"Modified: / 17-10-2012 / 13:01:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
18 |
! ! |
|
19 |
||
20 |
!HGTests methodsFor:'accessing'! |
|
21 |
||
22 |
repositoryNamed: nm |
|
23 |
| dir | |
|
24 |
||
25 |
dir := HGRepositoriesResource current directoryForRepositoryNamed: nm. |
|
26 |
repositories add: dir. |
|
27 |
^HGRepository on: dir. |
|
28 |
||
29 |
"Created: / 19-09-2012 / 19:04:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
30 |
"Modified: / 17-10-2012 / 13:28:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
31 |
! ! |
|
32 |
||
33 |
!HGTests methodsFor:'private'! |
|
34 |
||
35 |
performTest |
|
36 |
||
49
ffb879bfafe7
- stx_libscm_mercurial
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
37 |
HGAuthorQuery answer: 'HGTests <hgtests@nowhere>' do:[ |
34 | 38 |
super performTest |
39 |
]. |
|
40 |
||
41 |
"Created: / 30-09-2012 / 10:02:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
49
ffb879bfafe7
- stx_libscm_mercurial
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
42 |
"Modified: / 14-11-2012 / 19:42:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 43 |
! ! |
44 |
||
45 |
!HGTests methodsFor:'running'! |
|
46 |
||
47 |
setUp |
|
48 |
||
49 |
repositories := OrderedCollection new. |
|
50 |
||
51 |
"Created: / 19-09-2012 / 19:01:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
52 |
! |
|
53 |
||
54 |
tearDown |
|
55 |
||
56 |
repositories do:[:e| |
|
57 |
[ |
|
58 |
e asFilename recursiveRemove |
|
59 |
] on: Error do:[ |
|
60 |
"Stupid windows" |
|
61 |
] |
|
62 |
]. |
|
63 |
||
64 |
"Created: / 19-09-2012 / 19:03:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
65 |
"Modified: / 30-09-2012 / 05:26:48 / jv" |
|
66 |
! ! |
|
67 |
||
68 |
!HGTests methodsFor:'tests - basic workflow'! |
|
69 |
||
70 |
test_01a |
|
71 |
||
72 |
"Test modification of working copy and commit back" |
|
73 |
||
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
74 |
| repo wc f1_txt oldcs currentcs | |
34 | 75 |
|
76 |
repo := self repositoryNamed: 'test_repo_01'. |
|
77 |
" |
|
78 |
UserPreferences fileBrowserClass openOn: repo directory. |
|
79 |
" |
|
80 |
wc := repo workingCopy. |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
81 |
oldcs := wc changeset. |
40
e3699c0b00f9
Baisc support for changesets (revision log)
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
39
diff
changeset
|
82 |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
83 |
self assert: oldcs id revno == 4. |
34 | 84 |
|
85 |
"Modify some file" |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
86 |
f1_txt := wc / 'f1.txt'. |
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
87 |
self assert: f1_txt isModified not. |
34 | 88 |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
89 |
f1_txt writingFileDo:[:s| |
34 | 90 |
s nextPutAll: 'modified from test_01a'. |
91 |
]. |
|
38
c3d02ed6a645
- HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
36
diff
changeset
|
92 |
self assert: f1_txt isModified. |
34 | 93 |
|
94 |
wc commit: 'test_01a commit 1'. |
|
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
95 |
currentcs := wc changeset. |
34 | 96 |
|
39
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
97 |
self assert: f1_txt isModified not. |
46
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
98 |
self assert: currentcs id revno == 5. |
d5a192b11a1a
- More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
40
diff
changeset
|
99 |
self assert: currentcs parent1 = oldcs. |
49
ffb879bfafe7
- stx_libscm_mercurial
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
100 |
self assert: currentcs author = 'HGTests <hgtests@nowhere>' |
39
10e693b3e034
- Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
38
diff
changeset
|
101 |
|
34 | 102 |
"Created: / 19-09-2012 / 23:06:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
49
ffb879bfafe7
- stx_libscm_mercurial
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
46
diff
changeset
|
103 |
"Modified: / 14-11-2012 / 19:43:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
34 | 104 |
! ! |
105 |
||
106 |
!HGTests class methodsFor:'documentation'! |
|
107 |
||
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
49
diff
changeset
|
108 |
version_HG |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
49
diff
changeset
|
109 |
"Never, ever change this method. Ask JV or CG why" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
49
diff
changeset
|
110 |
^thisContext method mclass theNonMetaclass instVarNamed: #revision |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
49
diff
changeset
|
111 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
49
diff
changeset
|
112 |
|
34 | 113 |
version_SVN |
55 | 114 |
^ '§Id:: §' |
34 | 115 |
! ! |