aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/generic.expect
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generic.expect')
-rw-r--r--tests/generic.expect22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/generic.expect b/tests/generic.expect
index d422603a..7a5b6407 100644
--- a/tests/generic.expect
+++ b/tests/generic.expect
@@ -11,3 +11,25 @@ send_line "echo "
expect_prompt "" {} unmatched {
puts stderr "Couldn't type apple key ()"
}
+
+# check that history is returned in the right order (#2028)
+# this hist_command nonsense is the cleanest way to send the $ char
+set hist_command "echo \$history\[1\]"
+
+# first send 'echo stuff'
+send_line "echo stuff"
+expect_prompt "stuff" {} unmatched {
+ puts stderr "Couldn't find expected output 'stuff'"
+}
+
+# last history item should be 'echo stuff'
+send_line $hist_command
+expect_prompt "echo stuff" {} unmatched {
+ puts stderr "Couldn't find expected output 'echo stuff'"
+}
+
+# last history command should be the one that printed the history
+send_line $hist_command
+expect_prompt -re {echo .history.*} {} unmatched {
+ puts stderr "Couldn't find expected output $hist_command"
+}