Skip to content

Update tests for the latest code #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions tests/fixtures/restore_file.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
pane 0 0 :bash 1 :* 0 :/tmp 1 bash :
pane blue 0 :vim 0 : 0 :/tmp 1 vim :vim foo.txt
pane blue 1 :man 0 :- 0 :/tmp 0 bash :
pane blue 1 :man 0 :- 1 :/usr/share/man 1 man :man echo
pane blue 2 :bash 1 :* 0 :/tmp 1 bash :
pane red 0 :bash 0 : 0 :/tmp 1 bash :
pane red 1 :bash 0 :-Z 0 :/tmp 0 bash :
pane red 1 :bash 0 :-Z 1 :/tmp 0 bash :
pane red 1 :bash 0 :-Z 2 :/tmp 1 bash :
pane red 2 :bash 1 :* 0 :/tmp 0 bash :
pane red 2 :bash 1 :* 1 :/tmp 1 bash :
pane yellow 0 :bash 1 :* 0 :/tmp/bar 1 bash :
window 0 0 1 :* ce9e,200x49,0,0,1
window blue 0 0 : ce9f,200x49,0,0,2
window blue 1 0 :- 178b,200x49,0,0{100x49,0,0,3,99x49,101,0,4}
window blue 2 1 :* cea2,200x49,0,0,5
window red 0 0 : cea3,200x49,0,0,6
window red 1 0 :-Z 135b,200x49,0,0[200x24,0,0,7,200x24,0,25{100x24,0,25,8,99x24,101,25,9}]
window red 2 1 :* db81,200x49,0,0[200x24,0,0,10,200x24,0,25,11]
window yellow 0 1 :* 6781,200x49,0,0,12
pane 0 0 1 :* 0 localhost :/tmp 1 bash :
pane blue 0 0 :! 0 localhost :/tmp 1 vim :vim foo.txt
pane blue 1 0 :!- 0 localhost :/tmp 0 bash :
pane blue 1 0 :!- 1 localhost :/tmp 1 man :man echo
pane blue 2 1 :* 0 localhost :/tmp 1 bash :
pane red 0 0 : 0 localhost :/tmp 1 bash :
pane red 1 0 :-Z 0 localhost :/tmp 0 bash :
pane red 1 0 :-Z 1 localhost :/tmp 0 bash :
pane red 1 0 :-Z 2 localhost :/tmp 1 bash :
pane red 2 1 :* 0 localhost :/tmp 0 bash :
pane red 2 1 :* 1 localhost :/tmp 1 bash :
pane yellow 0 1 :* 0 localhost :/tmp/bar 1 bash :
window 0 0 :bash 1 :* ce9d,200x49,0,0,0 :
window blue 0 :vim 0 :! cea4,200x49,0,0,7 :
window blue 1 :man 0 :!- 9797,200x49,0,0{100x49,0,0,8,99x49,101,0,9} :
window blue 2 :bash 1 :* 677f,200x49,0,0,10 :
window red 0 :bash 0 : ce9e,200x49,0,0,1 :
window red 1 :bash 0 :-Z 52b7,200x49,0,0[200x24,0,0,2,200x24,0,25{100x24,0,25,3,99x24,101,25,4}] :
window red 2 :bash 1 :* bd68,200x49,0,0[200x24,0,0,5,200x24,0,25,6] :
window yellow 0 :bash 1 :* 6780,200x49,0,0,11 :
state yellow blue
40 changes: 20 additions & 20 deletions tests/fixtures/save_file.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
pane 0 0 :bash 1 :* 0 :/tmp 1 bash :
pane blue 0 :vim 0 :! 0 :/tmp 1 vim :vim foo.txt
pane blue 1 :man 0 :!- 0 :/tmp 0 bash :
pane blue 1 :man 0 :!- 1 :/usr/share/man 1 man :man echo
pane blue 2 :bash 1 :* 0 :/tmp 1 bash :
pane red 0 :bash 0 : 0 :/tmp 1 bash :
pane red 1 :bash 0 :-Z 0 :/tmp 0 bash :
pane red 1 :bash 0 :-Z 1 :/tmp 0 bash :
pane red 1 :bash 0 :-Z 2 :/tmp 1 bash :
pane red 2 :bash 1 :* 0 :/tmp 0 bash :
pane red 2 :bash 1 :* 1 :/tmp 1 bash :
pane yellow 0 :bash 1 :* 0 :/tmp/bar 1 bash :
window 0 0 1 :* ce9d,200x49,0,0,0
window blue 0 0 :! cea4,200x49,0,0,7
window blue 1 0 :!- 9797,200x49,0,0{100x49,0,0,8,99x49,101,0,9}
window blue 2 1 :* 677f,200x49,0,0,10
window red 0 0 : ce9e,200x49,0,0,1
window red 1 0 :-Z 52b7,200x49,0,0[200x24,0,0,2,200x24,0,25{100x24,0,25,3,99x24,101,25,4}]
window red 2 1 :* bd68,200x49,0,0[200x24,0,0,5,200x24,0,25,6]
window yellow 0 1 :* 6780,200x49,0,0,11
pane 0 0 1 :* 0 localhost :/tmp 1 bash :
pane blue 0 0 :! 0 localhost :/tmp 1 vim :vim foo.txt
pane blue 1 0 :!- 0 localhost :/tmp 0 bash :
pane blue 1 0 :!- 1 localhost :/tmp 1 man :man echo
pane blue 2 1 :* 0 localhost :/tmp 1 bash :
pane red 0 0 : 0 localhost :/tmp 1 bash :
pane red 1 0 :-Z 0 localhost :/tmp 0 bash :
pane red 1 0 :-Z 1 localhost :/tmp 0 bash :
pane red 1 0 :-Z 2 localhost :/tmp 1 bash :
pane red 2 1 :* 0 localhost :/tmp 0 bash :
pane red 2 1 :* 1 localhost :/tmp 1 bash :
pane yellow 0 1 :* 0 localhost :/tmp/bar 1 bash :
window 0 0 :bash 1 :* ce9d,200x49,0,0,0 :
window blue 0 :vim 0 :! cea4,200x49,0,0,7 :
window blue 1 :man 0 :!- 9797,200x49,0,0{100x49,0,0,8,99x49,101,0,9} :
window blue 2 :bash 1 :* 677f,200x49,0,0,10 :
window red 0 :bash 0 : ce9e,200x49,0,0,1 :
window red 1 :bash 0 :-Z 52b7,200x49,0,0[200x24,0,0,2,200x24,0,25{100x24,0,25,3,99x24,101,25,4}] :
window red 2 :bash 1 :* bd68,200x49,0,0[200x24,0,0,5,200x24,0,25,6] :
window yellow 0 :bash 1 :* 6780,200x49,0,0,11 :
state yellow blue
2 changes: 1 addition & 1 deletion tests/helpers/resurrect_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set_screen_dimensions_helper() {

last_save_file_differs_helper() {
local original_file="$1"
diff "$original_file" "${HOME}/.tmux/resurrect/last"
diff "$original_file" "${HOME}/.local/share/tmux//resurrect/last"
[ $? -ne 0 ]
}
7 changes: 6 additions & 1 deletion tests/test_resurrect_restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ source $CURRENT_DIR/helpers/helpers.sh
source $CURRENT_DIR/helpers/resurrect_helpers.sh

setup_before_restore() {
# setup restore file
# setup restore file. It looks like tmux now runs these tests under the
# plugin architecture, so resurrect's state files are actually stored under
# ~/.local/share/tmux/resurrect. However, it also appears that state files
# in ~/.tmux/resurrect are still respected, so we're going to install in the
# old location just to verify that behavior.
mkdir -p ~/.tmux/resurrect/
cp tests/fixtures/restore_file.txt "${HOME}/.tmux/resurrect/restore_file.txt"
ln -sf restore_file.txt "${HOME}/.tmux/resurrect/last"
Expand All @@ -24,6 +28,7 @@ main() {
install_tmux_plugin_under_test_helper
setup_before_restore
restore_tmux_environment_and_save_again
cp "${HOME}/.local/share/tmux//resurrect/last" actual_last.txt

if last_save_file_differs_helper "tests/fixtures/restore_file.txt"; then
fail_helper "Saved file not correct after restore"
Expand Down