Fossil SCM

Added new edge case tests to stash.test, related to stashing renamed files.

rberteig 2016-02-12 19:53 trunk
Commit 34cf38b0974fa518d3e95056028e47ebc1e9485e
1 file changed +56
--- test/stash.test
+++ test/stash.test
@@ -243,10 +243,67 @@
243243
} -exists {f1} -notexists {f1n} -knownbugs {-code -result}
244244
# TODO: add tests that verify the saved stash is sensible. Possibly
245245
# by applying it and checking results.
246246
247247
248
+repo_init
249
+write_file f1 "f1"
250
+write_file f2 "f2"
251
+fossil add f1 f2
252
+fossil commit -m "baseline"
253
+
254
+write_file f3 "f3"
255
+fossil add f3
256
+stash-test 3-1 {save -m f3} {
257
+ UNMANAGE f3
258
+} -addremove {
259
+ ADDED f3
260
+} -exists {f1 f2 f3} -notexists {}
261
+#fossil status
262
+fossil stash show
263
+test stash-3-1-show {[normalize_result] eq {ADDED f3
264
+Index: f3
265
+==================================================================
266
+--- f3
++++ f3
267
+@@ -0,0 +1,1 @@
268
++f3}}
269
+stash-test 3-1-pop {pop} {
270
+ ADDED f3
271
+} -changes {
272
+ ADDED f3
273
+} -addremove {
274
+} -exists {f1 f2 f3} -notexists {}
275
+fossil status
276
+
277
+
278
+
279
+repo_init
280
+write_file f1 "f1"
281
+write_file f2 "f2"
282
+fossil add f1 f2
283
+fossil commit -m "baseline"
284
+fossil mv --hard f2 f2n
285
+fossil changes
286
+stash-test 3-2 {save -m f2n} {
287
+ REVERT f2
288
+ DELETE f2n
289
+} -exists {f1 f2} -notexists {f2n} -knownbugs {-result}
290
+#fossil status
291
+fossil stash show
292
+test 3-2-show-1 {![regexp {\sf1} $RESULT]} knownBug
293
+test 3-2-show-2 {[regexp {\sf2n} $RESULT]}
294
+stash-test 3-2-pop {pop} {
295
+ UPDATE f1
296
+ UPDATE f2n
297
+} -changes {
298
+ RENAMED f2n
299
+} -addremove {
300
+ ADDED f2n
301
+ DELETED f2
302
+} -exists {f1 f2n} -notexists {f2} -knownbugs {-changes}
303
+
248304
# fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
249305
# fossil stash apply ?STASHID?
250306
# fossil stash goto ?STASHID?
251307
# fossil stash rm|drop ?STASHID? ?-a|--all?
252308
253309
--- test/stash.test
+++ test/stash.test
@@ -243,10 +243,67 @@
243 } -exists {f1} -notexists {f1n} -knownbugs {-code -result}
244 # TODO: add tests that verify the saved stash is sensible. Possibly
245 # by applying it and checking results.
246
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
++++ f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248 # fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
249 # fossil stash apply ?STASHID?
250 # fossil stash goto ?STASHID?
251 # fossil stash rm|drop ?STASHID? ?-a|--all?
252
253
--- test/stash.test
+++ test/stash.test
@@ -243,10 +243,67 @@
243 } -exists {f1} -notexists {f1n} -knownbugs {-code -result}
244 # TODO: add tests that verify the saved stash is sensible. Possibly
245 # by applying it and checking results.
246
247
248 repo_init
249 write_file f1 "f1"
250 write_file f2 "f2"
251 fossil add f1 f2
252 fossil commit -m "baseline"
253
254 write_file f3 "f3"
255 fossil add f3
256 stash-test 3-1 {save -m f3} {
257 UNMANAGE f3
258 } -addremove {
259 ADDED f3
260 } -exists {f1 f2 f3} -notexists {}
261 #fossil status
262 fossil stash show
263 test stash-3-1-show {[normalize_result] eq {ADDED f3
264 Index: f3
265 ==================================================================
266 --- f3
++++ f3
267 @@ -0,0 +1,1 @@
268 +f3}}
269 stash-test 3-1-pop {pop} {
270 ADDED f3
271 } -changes {
272 ADDED f3
273 } -addremove {
274 } -exists {f1 f2 f3} -notexists {}
275 fossil status
276
277
278
279 repo_init
280 write_file f1 "f1"
281 write_file f2 "f2"
282 fossil add f1 f2
283 fossil commit -m "baseline"
284 fossil mv --hard f2 f2n
285 fossil changes
286 stash-test 3-2 {save -m f2n} {
287 REVERT f2
288 DELETE f2n
289 } -exists {f1 f2} -notexists {f2n} -knownbugs {-result}
290 #fossil status
291 fossil stash show
292 test 3-2-show-1 {![regexp {\sf1} $RESULT]} knownBug
293 test 3-2-show-2 {[regexp {\sf2n} $RESULT]}
294 stash-test 3-2-pop {pop} {
295 UPDATE f1
296 UPDATE f2n
297 } -changes {
298 RENAMED f2n
299 } -addremove {
300 ADDED f2n
301 DELETED f2
302 } -exists {f1 f2n} -notexists {f2} -knownbugs {-changes}
303
304 # fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
305 # fossil stash apply ?STASHID?
306 # fossil stash goto ?STASHID?
307 # fossil stash rm|drop ?STASHID? ?-a|--all?
308
309

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button