Sha256: 9699dd7af67684a23a1b4fb50e9ffc6a38dcba64451febd7d91dfe8e3b7362b4

Contents?: true

Size: 788 Bytes

Versions: 2

Compression:

Stored size: 788 Bytes

Contents

#!/usr/bin/env ruby
require 'test/unit'
require_relative 'fn_helper'

class TestFinish < Test::Unit::TestCase

  include FnTestHelper

  def test_finish_between_fn
      # Finish over functions
      def fact(x)
          return 1 if x <= 1
          x = x * fact(x-1)
          return x
      end
      cmds = %w(step finish) + ['24 == x', 'continue']
      d = strarray_setup(cmds)
      d.start(true)
      ##############################
      x = fact(4)
      y = 5
      ##############################
      d.stop # ({:remove => true})
      out = ['line ',
             'x = fact(4)',
             'call ',
             'return 1 if x <= 1',
             'return ',
             'R=> 24',
             'end',
             'D=> true']
      compare_output(out, d, cmds)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trepanning-2.15.35 test/functional/test-finish.rb
trepanning-2.15.33 test/functional/test-finish.rb