fix and test class definition
This commit is contained in:
parent
7a690cd38d
commit
12e31f28c2
@ -22,7 +22,7 @@ module Parfait
|
|||||||
class Class < Object
|
class Class < Object
|
||||||
attributes [:object_layout , :name , :instance_methods , :super_class , :meta_class]
|
attributes [:object_layout , :name , :instance_methods , :super_class , :meta_class]
|
||||||
|
|
||||||
def initialize name , super_class
|
def initialize name , superclass
|
||||||
super()
|
super()
|
||||||
self.name = name
|
self.name = name
|
||||||
self.instance_methods = List.new
|
self.instance_methods = List.new
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
require_relative "test_if"
|
require_relative "test_if"
|
||||||
#require_relative "test_foo"
|
#require_relative "test_foo"
|
||||||
#require_relative "test_hello"
|
#require_relative "test_hello"
|
||||||
#require_relative "test_class"
|
require_relative "test_class"
|
||||||
#require_relative "test_putint"
|
#require_relative "test_putint"
|
||||||
#require_relative "test_functions"
|
#require_relative "test_functions"
|
||||||
#require_relative "test_recursive_fibo"
|
#require_relative "test_recursive_fibo"
|
||||||
|
@ -1,19 +1,24 @@
|
|||||||
require_relative 'helper'
|
require_relative 'helper'
|
||||||
|
|
||||||
|
module Register
|
||||||
class TestBasicClass < MiniTest::Test
|
class TestBasicClass < MiniTest::Test
|
||||||
include Fragments
|
include Fragments
|
||||||
|
|
||||||
def test_class_basic
|
def test_class_def
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
class Bar
|
class Bar
|
||||||
int buh()
|
int buh()
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
class Object
|
||||||
|
int main()
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
end
|
||||||
HERE
|
HERE
|
||||||
@expect = [ [SaveReturn] ,[RegisterTransfer,GetSlot,FunctionReturn]]
|
@length = 16
|
||||||
check
|
check
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user