Sha256: c3a7d8b1ca0c8c668061411b000b44c4d24f6447406fab3f497af2bf2e8caaee

Contents?: true

Size: 363 Bytes

Versions: 3

Compression:

Stored size: 363 Bytes

Contents

require 'test/unit'
require_relative '../generated/ImmutableStack'


class Stack_Test < Test::Unit::TestCase

  def test_push_pop
    stack = ImmutableStack.empty.push(1)
    stack = stack.push 2
    f, stack = stack.pop
    s, stack = stack.pop
    assert_equal(2, f)
    assert_equal(1, s)
    assert_equal(stack, ImmutableStack::empty)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maroon-0.8.0 Test/stack_test.rb
maroon-0.7.1 Test/stack_test.rb
maroon-0.7.0 Test/stack_test.rb