rearranging tests a little

This commit is contained in:
Torsten Ruger 2015-07-19 10:54:36 +03:00
parent ac9d5eaf5a
commit 7451493193
11 changed files with 39 additions and 34 deletions

View File

@ -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

View File

@ -0,0 +1,2 @@
require_relative "test_basic"
require_relative "test_methods"

View File

@ -1,4 +1,4 @@
require_relative "virtual_helper" require_relative "compiler_helper"
class TestBasic < MiniTest::Test class TestBasic < MiniTest::Test

View File

@ -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

View File

@ -1,4 +1,4 @@
require_relative "virtual_helper" require_relative "compiler_helper"
module Virtual module Virtual
class TestMethods < MiniTest::Test class TestMethods < MiniTest::Test

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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

View 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