rearranging tests a little
This commit is contained in:
parent
ac9d5eaf5a
commit
7451493193
@ -2,7 +2,7 @@ require_relative '../helper'
|
||||
require 'parslet/convenience'
|
||||
|
||||
|
||||
module VirtualHelper
|
||||
module CompilerHelper
|
||||
|
||||
def check
|
||||
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
|
@ -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
|
@ -1,4 +1,4 @@
|
||||
require_relative "virtual_helper"
|
||||
require_relative "compiler_helper"
|
||||
module Virtual
|
||||
class TestMethods < MiniTest::Test
|
||||
|
@ -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
|
||||
|
@ -4,3 +4,5 @@ require_relative "parfait/test_all"
|
||||
require_relative "fragments/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_padding"
|
||||
require_relative "test_positioning"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
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