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'
module VirtualHelper
module CompilerHelper
def check
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

View File

@ -1,7 +1,7 @@
require_relative "virtual_helper"
require_relative "compiler_helper"
class HelloTest < MiniTest::Test
include VirtualHelper
include CompilerHelper
def check
machine = Virtual::Machine.boot

View File

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

View File

@ -16,7 +16,6 @@ class TestSpace < MiniTest::Test
assert_equal Parfait::Space , Parfait::Space.object_space.class
end
def test_classes
assert_equal 16 , @machine.space.classes.length
[:Kernel,:Word,:List,:Message,:Frame,:Layout,:Class,:Dictionary,:Method].each do |name|
assert_equal Parfait::Class , @machine.space.classes[name].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 "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_padding"
require_relative "test_positioning"

View File

@ -1,7 +1,7 @@
require_relative "virtual_helper"
require_relative "compiler_helper"
class TestMethods < MiniTest::Test
include VirtualHelper
class TestMachine < MiniTest::Test
include CompilerHelper
def test_object
@string_input = <<HERE

View File

@ -19,28 +19,9 @@ class TestPadding < MiniTest::Test
assert_equal 64 , @pad.padded(p) , "Expecting 64 for #{p}"
end
end
def test_large
[58,88].each do |p|
assert_equal 96 , @pad.padded(p) , "Expecting 96 for #{p}"
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
def test_large
[58,88].each do |p|
assert_equal 96 , @pad.padded(p) , "Expecting 96 for #{p}"
end
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