From 113670040c5fa890004dbd59dfd336d829d336e5 Mon Sep 17 00:00:00 2001 From: Brian Graham Date: Wed, 31 Jul 2019 22:37:22 -0400 Subject: Allow negative ranges in hist --show Remove duplicate `opts[:show]` check in hist. --- spec/commands/hist_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec') diff --git a/spec/commands/hist_spec.rb b/spec/commands/hist_spec.rb index 2fbbffb6..3563d3e9 100644 --- a/spec/commands/hist_spec.rb +++ b/spec/commands/hist_spec.rb @@ -132,6 +132,15 @@ describe "hist" do expect(out).to match(/b\n\d+:.*c\n\d+:.*d/) end + it 'should show lines between offsets A and B with the --show switch' do + ("a".."f").each do |v| + @hist.push v + end + + out = @t.eval 'hist --show -4..-2' + expect(out).to eq "3: c\n4: d\n5: e\n" + end + it "should store a call with `--replay` flag" do @t.eval ":banzai" @t.eval "hist --replay 1" -- cgit v1.2.1