@@ -13,6 +13,14 @@ proc exit_status_false {} {
13
13
set exit_status 1
14
14
}
15
15
16
+ proc sync_tmux {} {
17
+ sleep 1.0
18
+ }
19
+
20
+ proc sync_irb {} {
21
+ sleep 5.0
22
+ }
23
+
16
24
proc teardown_and_exit {} {
17
25
global exit_status
18
26
_kill_tmux_server
@@ -25,84 +33,84 @@ proc create_output {} {
25
33
sleep 0.1
26
34
# stop `yes` command
27
35
send ""
28
- sleep 0.1
36
+ sync_tmux
29
37
}
30
38
31
39
proc clear_screen {} {
32
40
send ""
33
- sleep 0.1
41
+ sync_tmux
34
42
}
35
43
36
44
proc display_text {text} {
37
45
send "echo $text\r"
38
- sleep 0.3
46
+ sync_tmux
39
47
}
40
48
41
49
proc new_tmux_pane {} {
42
50
sleep 0.3
43
51
send "c"
44
- sleep 1
52
+ sleep 1.0
45
53
}
46
54
47
55
proc enter_irb {} {
48
56
send "irb\r"
49
- sleep 1
57
+ sync_irb
50
58
}
51
59
52
60
proc exit_irb {} {
53
61
send "\r"
54
- sleep 0.1
62
+ sync_irb
55
63
send "exit\r"
56
- sleep 0.5
64
+ sync_tmux
57
65
}
58
66
59
67
proc irb_display_text {text} {
60
68
send "puts '$text'\r"
61
- sleep 5.0
69
+ sync_irb
62
70
}
63
71
64
72
# Generates random output just to fill the screen.
65
73
proc irb_generate_output {} {
66
74
send "puts 'output\n' * 200\r"
67
- sleep 5.0
75
+ sync_irb
68
76
}
69
77
70
78
proc enter_test_git_repo {} {
71
- sleep 0.2
79
+ sync_tmux
72
80
send "cd ~/tmux-example-plugin\r"
73
- sleep 0.1
81
+ sync_tmux
74
82
send "git checkout --quiet tags/v0.0.1\r"
75
- sleep 0.2
83
+ sync_tmux
76
84
}
77
85
78
86
proc git_status {} {
79
- sleep 0.1
87
+ sync_tmux
80
88
send "git status --short\r"
81
- sleep 0.1
89
+ sync_tmux
82
90
}
83
91
84
92
proc git_log_reverse_short {} {
85
- sleep 0.1
93
+ sync_tmux
86
94
send "git --no-pager log --reverse --oneline -1\r"
87
- sleep 0.1
95
+ sync_tmux
88
96
}
89
97
90
98
proc git_log_reverse {} {
91
- sleep 0.1
99
+ sync_tmux
92
100
send "git --no-pager log --reverse -1\r"
93
- sleep 0.1
101
+ sync_tmux
94
102
}
95
103
96
104
proc git_checkout {} {
97
- sleep 0.1
105
+ sync_tmux
98
106
send "git checkout -- .\r"
99
- sleep 0.1
107
+ sync_tmux
100
108
}
101
109
102
110
proc git_clean_fd {} {
103
- sleep 0.1
111
+ sync_tmux
104
112
send "git clean -f -d\r"
105
- sleep 0.1
113
+ sync_tmux
106
114
}
107
115
108
116
proc clean_git_repo {} {
@@ -111,30 +119,31 @@ proc clean_git_repo {} {
111
119
}
112
120
113
121
proc change_file {file} {
114
- sleep 0.1
122
+ sync_tmux
115
123
send "echo 'change' > $file\r"
116
- sleep 0.1
124
+ sync_tmux
117
125
}
118
126
119
127
proc create_new_file_in_repo {} {
120
- sleep 0.1
128
+ sync_tmux
121
129
send "echo 'text' >> new_file.txt\r"
122
- sleep 0.1
130
+ sync_tmux
123
131
}
124
132
125
133
proc remove_test_git_repo {} {
126
- sleep 0.1
134
+ sync_tmux
127
135
send "cd ~\r"
128
- sleep 0.1
136
+ sync_tmux
129
137
send "rm -rf ~/tmux_example_plugin/\r"
130
- sleep 0.1
138
+ sync_tmux
131
139
}
132
140
133
141
# private functions
134
142
135
143
proc _kill_tmux_server {} {
136
144
send ""
137
- sleep 0.1
145
+ sync_tmux
138
146
send "tmux kill-server\r"
139
- sleep 0.2
147
+ sync_tmux
140
148
}
149
+
0 commit comments