rearranging tests a little
This commit is contained in:
parent
ac9d5eaf5a
commit
7451493193
@ -2,7 +2,7 @@ require_relative '../helper'
|
|||||||
require 'parslet/convenience'
|
require 'parslet/convenience'
|
||||||
|
|
||||||
|
|
||||||
module VirtualHelper
|
module CompilerHelper
|
||||||
|
|
||||||
def check
|
def check
|
||||||
Virtual.machine.boot.compile_main @string_input
|
Virtual.machine.boot.compile_main @string_input
|
2
test/compiler/test_all.rb
Normal file
2
test/compiler/test_all.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
require_relative "test_basic"
|
||||||
|
require_relative "test_methods"
|
@ -1,4 +1,4 @@
|
|||||||
require_relative "virtual_helper"
|
require_relative "compiler_helper"
|
||||||
|
|
||||||
|
|
||||||
class TestBasic < MiniTest::Test
|
class TestBasic < MiniTest::Test
|
@ -1,7 +1,7 @@
|
|||||||
require_relative "virtual_helper"
|
require_relative "compiler_helper"
|
||||||
|
|
||||||
class HelloTest < MiniTest::Test
|
class HelloTest < MiniTest::Test
|
||||||
include VirtualHelper
|
include CompilerHelper
|
||||||
|
|
||||||
def check
|
def check
|
||||||
machine = Virtual::Machine.boot
|
machine = Virtual::Machine.boot
|
@ -1,4 +1,4 @@
|
|||||||
require_relative "virtual_helper"
|
require_relative "compiler_helper"
|
||||||
module Virtual
|
module Virtual
|
||||||
class TestMethods < MiniTest::Test
|
class TestMethods < MiniTest::Test
|
||||||
|
|
@ -16,7 +16,6 @@ class TestSpace < MiniTest::Test
|
|||||||
assert_equal Parfait::Space , Parfait::Space.object_space.class
|
assert_equal Parfait::Space , Parfait::Space.object_space.class
|
||||||
end
|
end
|
||||||
def test_classes
|
def test_classes
|
||||||
assert_equal 16 , @machine.space.classes.length
|
|
||||||
[:Kernel,:Word,:List,:Message,:Frame,:Layout,:Class,:Dictionary,:Method].each do |name|
|
[:Kernel,:Word,:List,:Message,:Frame,:Layout,:Class,:Dictionary,:Method].each do |name|
|
||||||
assert_equal Parfait::Class , @machine.space.classes[name].class
|
assert_equal Parfait::Class , @machine.space.classes[name].class
|
||||||
assert_equal Parfait::Layout , @machine.space.classes[name].get_layout.class
|
assert_equal Parfait::Layout , @machine.space.classes[name].get_layout.class
|
||||||
|
@ -4,3 +4,5 @@ require_relative "parfait/test_all"
|
|||||||
require_relative "fragments/test_all"
|
require_relative "fragments/test_all"
|
||||||
|
|
||||||
require_relative "virtual/test_all"
|
require_relative "virtual/test_all"
|
||||||
|
|
||||||
|
require_relative "compiler/test_all"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
require_relative "test_basic"
|
|
||||||
require_relative "test_methods"
|
|
||||||
require_relative "test_compat"
|
require_relative "test_compat"
|
||||||
|
require_relative "test_padding"
|
||||||
|
require_relative "test_positioning"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
require_relative "virtual_helper"
|
require_relative "compiler_helper"
|
||||||
|
|
||||||
class TestMethods < MiniTest::Test
|
class TestMachine < MiniTest::Test
|
||||||
include VirtualHelper
|
include CompilerHelper
|
||||||
|
|
||||||
def test_object
|
def test_object
|
||||||
@string_input = <<HERE
|
@string_input = <<HERE
|
||||||
|
@ -25,22 +25,3 @@ def test_large
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestPositioning < MiniTest::Test
|
|
||||||
def test_list1
|
|
||||||
list = Virtual.new_list([1])
|
|
||||||
list.set_layout( Parfait::Layout.new Object)
|
|
||||||
assert_equal 32 , list.word_length
|
|
||||||
end
|
|
||||||
def test_list5
|
|
||||||
list = Virtual.new_list([1,2,3,4,5])
|
|
||||||
list.set_layout( Parfait::Layout.new Object)
|
|
||||||
assert_equal 32 , list.word_length
|
|
||||||
end
|
|
||||||
def test_layout
|
|
||||||
layout = Parfait::Layout.new Object
|
|
||||||
layout.set_layout( Parfait::Layout.new Object)
|
|
||||||
layout.push 5
|
|
||||||
assert_equal 32 , layout.word_length
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
20
test/virtual/test_positioning.rb
Normal file
20
test/virtual/test_positioning.rb
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
require_relative "../helper"
|
||||||
|
|
||||||
|
class TestPositioning < MiniTest::Test
|
||||||
|
def test_list1
|
||||||
|
list = Virtual.new_list([1])
|
||||||
|
list.set_layout( Parfait::Layout.new Object)
|
||||||
|
assert_equal 32 , list.word_length
|
||||||
|
end
|
||||||
|
def test_list5
|
||||||
|
list = Virtual.new_list([1,2,3,4,5])
|
||||||
|
list.set_layout( Parfait::Layout.new Object)
|
||||||
|
assert_equal 32 , list.word_length
|
||||||
|
end
|
||||||
|
def test_layout
|
||||||
|
layout = Parfait::Layout.new Object
|
||||||
|
layout.set_layout( Parfait::Layout.new Object)
|
||||||
|
layout.push 5
|
||||||
|
assert_equal 32 , layout.word_length
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user