From 2ec0b671e660b8a7d505a7ffb24a171cea6d8dde Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Sun, 16 Oct 2022 16:26:01 +0900 Subject: [PATCH] test: update stash/rename integration test --- pkg/integration/tests/stash/rename.go | 10 +++++++--- .../rename/expected/repo/.git_keep/ORIG_HEAD | 2 +- .../rename/expected/repo/.git_keep/logs/HEAD | 5 +++-- .../repo/.git_keep/logs/refs/heads/master | 2 +- .../expected/repo/.git_keep/logs/refs/stash | 3 ++- .../20/9b9fa9264fa15f128127817f080fd7372050cf | 3 +++ .../25/0122ffb92a8c1c2a6554ce2ac84b49e5f3afe3 | Bin 31 -> 0 bytes .../43/a4e12864cee1d7020a6d22772f0be34a24d257 | Bin 0 -> 162 bytes .../4d/ff185ecddfb638f76215fa07adde0f4e97da7c | 2 -- .../65/d11c8b2d3c173850f337661c9bf264d0406cf1 | 4 ++++ .../71/2f414b554b56ba82d43e1f7a0fe33be7eecc95 | Bin 0 -> 32 bytes .../86/8a798775e91d6387f351add6c5abf06cdb3357 | Bin 0 -> 51 bytes .../8d/4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf | 2 -- .../a5/272a200897df5558c8cad683c1af14f7184124 | 3 +++ .../b2/3d362d3fa47c3b1f29c4dd41c419326415122c | Bin 0 -> 51 bytes .../c6/f35659c0cf57c794d79df88283d7ee933831dd | Bin 181 -> 0 bytes .../dc/052e9e4df6fe8f66b7e110466e1db8ce104b8b | Bin 0 -> 32 bytes .../de/8f5ed6f8a58664edfbdecd20b75a6ea0633bf6 | 1 + .../fc/66bff0a9fdfe660b6e490dc217a9c26ffc5fff | Bin 48 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 2 +- .../rename/expected/repo/.git_keep/refs/stash | 2 +- 21 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/20/9b9fa9264fa15f128127817f080fd7372050cf delete mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/25/0122ffb92a8c1c2a6554ce2ac84b49e5f3afe3 create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/43/a4e12864cee1d7020a6d22772f0be34a24d257 delete mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/4d/ff185ecddfb638f76215fa07adde0f4e97da7c create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/65/d11c8b2d3c173850f337661c9bf264d0406cf1 create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/71/2f414b554b56ba82d43e1f7a0fe33be7eecc95 create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/86/8a798775e91d6387f351add6c5abf06cdb3357 delete mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/8d/4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/a5/272a200897df5558c8cad683c1af14f7184124 create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/b2/3d362d3fa47c3b1f29c4dd41c419326415122c delete mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/c6/f35659c0cf57c794d79df88283d7ee933831dd create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/dc/052e9e4df6fe8f66b7e110466e1db8ce104b8b create mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/de/8f5ed6f8a58664edfbdecd20b75a6ea0633bf6 delete mode 100644 test/integration_new/stash/rename/expected/repo/.git_keep/objects/fc/66bff0a9fdfe660b6e490dc217a9c26ffc5fff diff --git a/pkg/integration/tests/stash/rename.go b/pkg/integration/tests/stash/rename.go index 97cfae006..761d7135b 100644 --- a/pkg/integration/tests/stash/rename.go +++ b/pkg/integration/tests/stash/rename.go @@ -13,7 +13,9 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{ SetupRepo: func(shell *Shell) { shell. EmptyCommit("blah"). - CreateFileAndAdd("foo", "change to stash"). + CreateFileAndAdd("file-1", "change to stash1"). + StashWithMessage("foo"). + CreateFileAndAdd("file-2", "change to stash2"). StashWithMessage("bar") }, Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { @@ -21,13 +23,15 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{ assert.CurrentViewName("stash") assert.MatchSelectedLine(Equals("On master: bar")) + input.NextItem() + assert.MatchSelectedLine(Equals("On master: foo")) input.PressKeys(keys.Stash.RenameStash) assert.InPrompt() - assert.MatchCurrentViewTitle(Equals("Rename stash: stash@{0}")) + assert.MatchCurrentViewTitle(Equals("Rename stash: stash@{1}")) input.Type(" baz") input.Confirm() - assert.MatchSelectedLine(Equals("On master: bar baz")) + assert.MatchSelectedLine(Equals("On master: foo baz")) }, }) diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/ORIG_HEAD b/test/integration_new/stash/rename/expected/repo/.git_keep/ORIG_HEAD index 4db7189cb..6d340468f 100644 --- a/test/integration_new/stash/rename/expected/repo/.git_keep/ORIG_HEAD +++ b/test/integration_new/stash/rename/expected/repo/.git_keep/ORIG_HEAD @@ -1 +1 @@ -8d4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf +209b9fa9264fa15f128127817f080fd7372050cf diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/logs/HEAD b/test/integration_new/stash/rename/expected/repo/.git_keep/logs/HEAD index bca9be914..93b01e488 100644 --- a/test/integration_new/stash/rename/expected/repo/.git_keep/logs/HEAD +++ b/test/integration_new/stash/rename/expected/repo/.git_keep/logs/HEAD @@ -1,2 +1,3 @@ -0000000000000000000000000000000000000000 8d4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf CI 1665802395 +0900 commit (initial): blah -8d4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf 8d4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf CI 1665802396 +0900 reset: moving to HEAD +0000000000000000000000000000000000000000 209b9fa9264fa15f128127817f080fd7372050cf CI 1665905121 +0900 commit (initial): blah +209b9fa9264fa15f128127817f080fd7372050cf 209b9fa9264fa15f128127817f080fd7372050cf CI 1665905122 +0900 reset: moving to HEAD +209b9fa9264fa15f128127817f080fd7372050cf 209b9fa9264fa15f128127817f080fd7372050cf CI 1665905122 +0900 reset: moving to HEAD diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/heads/master b/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/heads/master index 698928dd3..f1bfb4ca0 100644 --- a/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/heads/master +++ b/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/heads/master @@ -1 +1 @@ -0000000000000000000000000000000000000000 8d4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf CI 1665802395 +0900 commit (initial): blah +0000000000000000000000000000000000000000 209b9fa9264fa15f128127817f080fd7372050cf CI 1665905121 +0900 commit (initial): blah diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/stash b/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/stash index 02b7af510..5addb2d25 100644 --- a/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/stash +++ b/test/integration_new/stash/rename/expected/repo/.git_keep/logs/refs/stash @@ -1 +1,2 @@ -0000000000000000000000000000000000000000 c6f35659c0cf57c794d79df88283d7ee933831dd CI 1665802399 +0900 On master: bar baz +0000000000000000000000000000000000000000 a5272a200897df5558c8cad683c1af14f7184124 CI 1665905122 +0900 On master: bar +a5272a200897df5558c8cad683c1af14f7184124 de8f5ed6f8a58664edfbdecd20b75a6ea0633bf6 CI 1665905125 +0900 On master: foo baz diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/20/9b9fa9264fa15f128127817f080fd7372050cf b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/20/9b9fa9264fa15f128127817f080fd7372050cf new file mode 100644 index 000000000..b0b57c478 --- /dev/null +++ b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/20/9b9fa9264fa15f128127817f080fd7372050cf @@ -0,0 +1,3 @@ +x1 +0 @>B]YXPB Sa9 +)ĸz]?~i;xza)ĥ0l*-ia )jFoi4ۣ:gwDwkOtϛ;+ \ No newline at end of file diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/25/0122ffb92a8c1c2a6554ce2ac84b49e5f3afe3 b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/25/0122ffb92a8c1c2a6554ce2ac84b49e5f3afe3 deleted file mode 100644 index 2a62b4b9d117b02f668e94e9d15e38d53e04515e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31 ncmbwEUWXZ&xYRoB zpvj%~Eobn~3kT0^bD-pm=VB~LN-kO%3c8pEV=Svxwmi2G!w`xD?XE@07Sf(Hd*Xr~ zOJc(sEykkcvyaOLT@UxJf96B#`pTEM)CZ7rHlQV~;fw)MHQJ{3{HLy_IpqVE8LGTn Qb^Bex@RCt|0jfqohXv_Sxc~qF literal 0 HcmV?d00001 diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/4d/ff185ecddfb638f76215fa07adde0f4e97da7c b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/4d/ff185ecddfb638f76215fa07adde0f4e97da7c deleted file mode 100644 index 6d964ed92..000000000 --- a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/4d/ff185ecddfb638f76215fa07adde0f4e97da7c +++ /dev/null @@ -1,2 +0,0 @@ -xA -0E)f_(1)\yd2Q)x龋לKE@1@TmDi&vUrf ,|je\wxKYn'T&%k͹QEʹ$9`] a4_C^ \ No newline at end of file diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/65/d11c8b2d3c173850f337661c9bf264d0406cf1 b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/65/d11c8b2d3c173850f337661c9bf264d0406cf1 new file mode 100644 index 000000000..ac5229d86 --- /dev/null +++ b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/65/d11c8b2d3c173850f337661c9bf264d0406cf1 @@ -0,0 +1,4 @@ +x +0=).&MzcL[j>|R +LTRs)6EVVs@fg[u'6==ha0duZwF #lt kiY-hiϹX(ը +Mr@% \ No newline at end of file diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/71/2f414b554b56ba82d43e1f7a0fe33be7eecc95 b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/71/2f414b554b56ba82d43e1f7a0fe33be7eecc95 new file mode 100644 index 0000000000000000000000000000000000000000..4b6819c3a2d169b8348253ad5ceaca40d5a55a25 GIT binary patch literal 32 ncmb9VK6i>Ff%bxNXyJg)iq=&)OYj_^$y$Bbj41-ivO|o^LJ;a J0ssa(4)OEx73BZ` literal 0 HcmV?d00001 diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/8d/4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/8d/4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf deleted file mode 100644 index 98e81aa49..000000000 --- a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/8d/4897b3dcbb5c8fbc8fa8439ec7e9627c3159cf +++ /dev/null @@ -1,2 +0,0 @@ -x -0 a}ɺ4$ "h +Qw烿Z_/p2i)LiFFOd,Qd5wR?}kL3ܧ\߻J`51t~?+ \ No newline at end of file diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/a5/272a200897df5558c8cad683c1af14f7184124 b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/a5/272a200897df5558c8cad683c1af14f7184124 new file mode 100644 index 000000000..32ae211fe --- /dev/null +++ b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/a5/272a200897df5558c8cad683c1af14f7184124 @@ -0,0 +1,3 @@ +xj1]Sѯ1pU~i%g.g[.ҧfvG޿wC65S+{JIlbb[ 4ahFH)D +Dx*2.9x +(NsKqkGYA]41boħ3)y{OHW \ No newline at end of file diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/b2/3d362d3fa47c3b1f29c4dd41c419326415122c b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/b2/3d362d3fa47c3b1f29c4dd41c419326415122c new file mode 100644 index 0000000000000000000000000000000000000000..eae6abec12b5ec05d82c11834bb328fde31ac5c1 GIT binary patch literal 51 zcmV-30L=e*0V^p=O;s>9VK6i>Ff%bxNXyJg)iq+c!>TvW_uIezwCxWC-1201oD=Zw J1^^yL4^9d!75V@G literal 0 HcmV?d00001 diff --git a/test/integration_new/stash/rename/expected/repo/.git_keep/objects/c6/f35659c0cf57c794d79df88283d7ee933831dd b/test/integration_new/stash/rename/expected/repo/.git_keep/objects/c6/f35659c0cf57c794d79df88283d7ee933831dd deleted file mode 100644 index 0eda983672af0f73b4c2736daef7cb465e6ca4f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 181 zcmV;m080OO0gcbQY6CG4h2hlu6zT&;*OA5q6L96q&oG(`2}EAAks*(ttz5e}&Ck~y zUdQ;JF6Q<&H&tg0(9Jxdi79~Zpc%bz43&^0m~k<)