rubyx/test/virtual/virtual_helper.rb

31 lines
875 B
Ruby
Raw Normal View History

2014-06-25 14:20:46 +02:00
require_relative '../helper'
require 'parslet/convenience'
require "yaml"
2014-06-25 14:20:46 +02:00
2014-06-26 10:34:48 +02:00
module VirtualHelper
2015-05-05 13:04:37 +02:00
# need a code generator, for arm
2014-06-25 14:20:46 +02:00
def setup
# @object_space = Boot::Space.new "Arm"
2014-06-25 14:20:46 +02:00
end
2014-07-30 20:07:48 +02:00
def check
machine = Virtual::Machine.reboot
2014-07-30 20:43:12 +02:00
expressions = machine.compile_main @string_input
2015-05-24 15:55:03 +02:00
if( expressions.first.is_a? Parfait::Method )
# stops the whole objectspace beeing tested
# with the class comes superclass and all methods
expressions.first.instance_variable_set :@for_class , nil
end
if( expressions.first.is_a? Virtual::Self )
# stops the whole objectspace beeing tested
# with the class comes superclass and all methods
expressions.first.type.instance_variable_set :@of_class , nil
end
2015-05-05 14:11:09 +02:00
is = Sof::Writer.write(expressions)
2015-05-06 07:38:29 +02:00
#puts is
2015-05-05 14:11:09 +02:00
is.gsub!("\n" , "*^*")
2015-05-05 13:04:37 +02:00
assert_equal is , @output
2014-06-25 14:20:46 +02:00
end
2015-05-05 13:04:37 +02:00
2014-06-25 14:20:46 +02:00
end