improve tests
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
require_relative "test_foo"
|
||||
require_relative "test_if"
|
||||
require_relative "test_hello"
|
||||
require_relative "test_class"
|
||||
require_relative "test_putint"
|
||||
require_relative "test_functions"
|
||||
require_relative "test_recursive_fibo"
|
||||
|
21
test/fragments/test_class.rb
Normal file
21
test/fragments/test_class.rb
Normal file
@ -0,0 +1,21 @@
|
||||
require_relative 'helper'
|
||||
|
||||
class TestBasicClass < MiniTest::Test
|
||||
include Fragments
|
||||
|
||||
def test_class_basic
|
||||
@string_input = <<HERE
|
||||
module Foo
|
||||
class Bar
|
||||
int buh()
|
||||
return 1
|
||||
end
|
||||
end
|
||||
end
|
||||
HERE
|
||||
@expect = [ Virtual::Return ]
|
||||
check
|
||||
end
|
||||
|
||||
|
||||
end
|
@ -5,6 +5,16 @@ class TestList < MiniTest::Test
|
||||
def setup
|
||||
@list = ::Parfait::List.new
|
||||
end
|
||||
def test_list_inspect
|
||||
@list.set(1,1)
|
||||
assert_equal "1" , @list.inspect
|
||||
end
|
||||
def test_list_equal
|
||||
@list.set(1,1)
|
||||
list = ::Parfait::List.new
|
||||
list.set(1,1)
|
||||
assert @list.equal? list
|
||||
end
|
||||
def test_list_create
|
||||
assert @list.empty?
|
||||
end
|
||||
|
Reference in New Issue
Block a user