<commit_before>module Byebug
  class ContinueExample
    def self.a(num)
      num + 4
    end
  end

  class ContinueTestCase < TestCase
    def setup
      @example = lambda do
        byebug

        b = 5
        c = b + 5
        ContinueExample.a(c)
      end

      super
    end

    def test_continues_up_to_breakpoint_if_no_line_specified
      enter 'break 14', 'continue'
      debug_proc(@example) { assert_equal 14, state.line }
    end

    def test_works_in_abbreviated_mode_too
      enter 'break 14', 'cont'
      debug_proc(@example) { assert_equal 14, state.line }
    end

    def test_continues_up_to_the_specified_line
      enter 'cont 14'
      debug_proc(@example) { assert_equal 14, state.line }
    end

    def test_ignores_the_command_if_specified_line_is_not_valid
      enter 'cont 100'
      debug_proc(@example) { assert_equal 13, state.line }
    end

    def test_shows_error_if_specified_line_is_not_valid
      enter 'cont 100'
      debug_proc(@example)<commit_msg>Migrate continue test to use debug_code method<commit_after>module Byebug
  #
  # Tests for continue command
  #
  class ContinueTestCase < TestCase
    def program
      strip_line_numbers <<-EOC
         1:  module Byebug
         2:    #
         3:    # Toy class to test continue command.
         4:    #
         5:    class TestExample
         6:      def add_four(num)
         7:        num + 4
         8:      end
         9:    end
        10:
        11:    byebug
        12:
        13:    b = 5
        14:    c = b + 5
        15:    TestExample.new.add_four(c)
        16:  end
      EOC
    end

    def test_continues_up_to_breakpoint_if_no_line_specified
      enter 'break 14', 'continue'
      debug_code(program) { assert_equal 14, state.line }
    end

    def test_works_in_abbreviated_mode_too
      enter 'break 14', 'cont'
      debug_code(program) { assert_equal 14, state.line }
    end

    def test_continues_up_to_the_specified_line
      enter 'cont 14'
      debug_code(program) { assert_equal 14, state.line }
    end

    def test_ignores_the_command_if_specified_line_is_not_valid
      enter 'cont 100'
      debug_code(program) { assert_equal 13, state.line }
    end

    def test_shows_error_if_specified_line_is_not_valid
      enter 'cont 100'
      debug_code(program)
{'fraction_non_alphanumeric': 0.0625, 'fraction_numerical': 0.029741379310344828, 'mean_word_length': 2.2013793103448274, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7196783', 'n_tokens_mistral': 827, 'n_tokens_neox': 749, 'n_words': 184}