using yaml as the storage format of the result as it handles graphs out of the box
This commit is contained in:
parent
98db88ac2f
commit
2e79caa791
@ -23,7 +23,7 @@ module Virtual
|
|||||||
end
|
end
|
||||||
|
|
||||||
def inspect
|
def inspect
|
||||||
self.class.name + ".new(" + attributes.collect{|a| send(a).inspect }.join(",")+ ")"
|
to_yaml
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.space
|
def self.space
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
require_relative '../helper'
|
require_relative '../helper'
|
||||||
require 'parslet/convenience'
|
require 'parslet/convenience'
|
||||||
|
require "yaml"
|
||||||
|
|
||||||
module VirtualHelper
|
module VirtualHelper
|
||||||
# need a code generator, for arm
|
# need a code generator, for arm
|
||||||
@ -14,7 +15,8 @@ module VirtualHelper
|
|||||||
machine = Virtual::Machine.new
|
machine = Virtual::Machine.new
|
||||||
main = Virtual::MethodDefinition.main
|
main = Virtual::MethodDefinition.main
|
||||||
expressions = parts.compile(machine.frame , main )
|
expressions = parts.compile(machine.frame , main )
|
||||||
assert_equal @output , expressions
|
should = YAML.load(@output.gsub("_MY_MY_MARKER" , "\n"))
|
||||||
|
assert_equal should , expressions , expressions.to_yaml.gsub("\n" , "_MY_MY_MARKER") + "\n" + expressions.to_yaml
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user