File: interrupt_test.rb

package info (click to toggle)
ruby-byebug 11.1.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,252 kB
  • sloc: ruby: 8,835; ansic: 1,662; sh: 6; makefile: 4
file content (36 lines) | stat: -rw-r--r-- 705 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

require "test_helper"

module Byebug
  #
  # Tests interrupt command.
  #
  class InterruptTest < TestCase
    def program
      strip_line_numbers <<-RUBY
         1:  module Byebug
         2:    byebug
         3:
         4:    ex = 0
         5:
         6:    1.times do
         7:      ex += 1
         8:    end
         9:  end
      RUBY
    end

    def test_interrupt_stops_at_the_next_statement
      enter "interrupt", "continue"

      debug_code(program) { assert_equal 6, frame.line }
    end

    def _test_interrupt_steps_into_blocks
      enter "next", "interrupt", "continue"

      debug_code(program) { assert_equal 7, frame.line }
    end
  end
end