summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_cmd.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/irb/test_cmd.rb b/test/irb/test_cmd.rb
index c8c163c82d..71df60db14 100644
--- a/test/irb/test_cmd.rb
+++ b/test/irb/test_cmd.rb
@@ -252,6 +252,34 @@ module TestIRB
assert_empty(c.class_variables)
end
+ def test_measure_keeps_previous_value
+ conf = {
+ PROMPT: {
+ DEFAULT: {
+ PROMPT_I: '> ',
+ PROMPT_S: '> ',
+ PROMPT_C: '> ',
+ PROMPT_N: '> '
+ }
+ },
+ PROMPT_MODE: :DEFAULT,
+ MEASURE: false
+ }
+
+ c = Class.new(Object)
+ out, err = execute_lines(
+ "measure\n",
+ "3\n",
+ "_\n",
+ conf: conf,
+ main: c
+ )
+
+ assert_empty err
+ assert_match(/\ATIME is added\.\n=> nil\nprocessing time: .+\n=> 3\nprocessing time: .+\n=> 3/, out)
+ assert_empty(c.class_variables)
+ end
+
def test_measure_enabled_by_rc
conf = {
PROMPT: {