Rename SlotMaker to Variable
Feels like now with better names, i can start to work.
This commit is contained in:
@ -35,7 +35,7 @@ module SlotLanguage
|
||||
load = compile("word = name.member")
|
||||
assert_equal Assignment , load.class
|
||||
assert_equal :word , load.left.names.first
|
||||
assert_equal SlotMaker , load.right.class
|
||||
assert_equal Variable , load.right.class
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -7,8 +7,8 @@ module SlotLanguage
|
||||
def do_check(check)
|
||||
assert_equal EqualGoto , check.class
|
||||
assert_equal Goto , check.goto.class
|
||||
assert_equal SlotMaker , check.left.class
|
||||
assert_equal SlotMaker , check.right.class
|
||||
assert_equal Variable , check.left.class
|
||||
assert_equal Variable , check.right.class
|
||||
end
|
||||
def test_equal_local
|
||||
check = compile("goto(exit_label) if(a == b)")
|
||||
@ -49,11 +49,11 @@ module SlotLanguage
|
||||
assert_equal @expr.first.object_id , @expr.last.goto.label.object_id
|
||||
end
|
||||
def test_expression_left
|
||||
assert_equal SlotMaker , @expr.last.left.class
|
||||
assert_equal Variable , @expr.last.left.class
|
||||
assert_equal [:b] , @expr.last.left.names
|
||||
end
|
||||
def test_expression_right
|
||||
assert_equal SlotMaker , @expr.last.right.class
|
||||
assert_equal Variable , @expr.last.right.class
|
||||
assert_equal [:c] , @expr.last.right.names
|
||||
end
|
||||
end
|
||||
|
@ -10,8 +10,8 @@ module SlotLanguage
|
||||
def test_labels
|
||||
assert SlotCompiler.new.labels.empty?
|
||||
end
|
||||
def test_compile
|
||||
assert_equal SlotMaker , compile("a").class
|
||||
def test_basic_compile
|
||||
assert_equal Variable , compile("a").class
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,14 +0,0 @@
|
||||
require_relative "helper"
|
||||
|
||||
module SlotLanguage
|
||||
class TestSlotMaker < MiniTest::Test
|
||||
include SlotToHelper
|
||||
def setup
|
||||
super
|
||||
@maker = SlotMaker.new(:hi )
|
||||
end
|
||||
def test_slot
|
||||
@maker.to_slot(@compiler)
|
||||
end
|
||||
end
|
||||
end
|
10
test/slot_language/test_variable.rb
Normal file
10
test/slot_language/test_variable.rb
Normal file
@ -0,0 +1,10 @@
|
||||
require_relative "helper"
|
||||
|
||||
module SlotLanguage
|
||||
class TestVariable < MiniTest::Test
|
||||
include SlotHelper
|
||||
def test_basic_compile
|
||||
assert_equal Variable , compile("a").class
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user