fix all tests to use space.main
This commit is contained in:
@ -10,7 +10,7 @@ class TestAssignStatement < MiniTest::Test
|
||||
|
||||
def test_assign_op
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int n = 10 + 1
|
||||
end
|
||||
@ -23,7 +23,7 @@ HERE
|
||||
|
||||
def test_assign_local
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int runner
|
||||
runner = 5
|
||||
@ -36,7 +36,7 @@ HERE
|
||||
|
||||
def test_assign_local_assign
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int runner = 5
|
||||
end
|
||||
@ -48,7 +48,7 @@ HERE
|
||||
|
||||
def test_assign_call
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int r = main()
|
||||
end
|
||||
@ -62,7 +62,7 @@ HERE
|
||||
|
||||
def test_frame_get
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int r = 5
|
||||
return r
|
||||
@ -80,7 +80,7 @@ HERE
|
||||
def test_assign_arg
|
||||
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :blar)
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main(int blar)
|
||||
blar = 5
|
||||
end
|
||||
@ -95,7 +95,7 @@ HERE
|
||||
|
||||
def test_assign_int
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int r = 5
|
||||
end
|
||||
@ -112,7 +112,7 @@ HERE
|
||||
# have to define bar externally, just because redefining main. Otherwise that would be automatic
|
||||
Register.machine.space.get_main.arguments.push Parfait::Variable.new(:Integer , :balr)
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main(int balr)
|
||||
return balr
|
||||
end
|
||||
|
@ -11,7 +11,7 @@ class Integer
|
||||
return 1
|
||||
end
|
||||
end
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
42.putint()
|
||||
end
|
||||
@ -31,7 +31,7 @@ class Word
|
||||
return 1
|
||||
end
|
||||
end
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
"Hello".putstring()
|
||||
end
|
||||
@ -50,7 +50,7 @@ class Integer
|
||||
return 1
|
||||
end
|
||||
end
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int testi = 20
|
||||
testi.putint()
|
||||
@ -71,7 +71,7 @@ class List < Object
|
||||
return 1
|
||||
end
|
||||
end
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
List test_l
|
||||
test_l.add()
|
||||
@ -86,7 +86,7 @@ HERE
|
||||
|
||||
def test_call_puts
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int puts(Word str)
|
||||
return str
|
||||
end
|
||||
|
@ -11,7 +11,7 @@ class Bar
|
||||
return 1
|
||||
end
|
||||
end
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
return 1
|
||||
end
|
||||
@ -28,7 +28,7 @@ class Bar
|
||||
return 1
|
||||
end
|
||||
end
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
return Bar.buh()
|
||||
end
|
||||
@ -42,7 +42,7 @@ HERE
|
||||
|
||||
def test_class_field_value
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
field int boo1 = 1
|
||||
int main()
|
||||
return 1
|
||||
@ -55,7 +55,7 @@ HERE
|
||||
|
||||
def test_class_field
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
field int boo2
|
||||
int main()
|
||||
return self.boo2
|
||||
|
@ -7,7 +7,7 @@ module Register
|
||||
|
||||
def test_field_frame
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
Message m
|
||||
return m.name
|
||||
@ -20,7 +20,7 @@ HERE
|
||||
|
||||
def test_field_arg
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int get_name(Message main)
|
||||
return main.name
|
||||
end
|
||||
@ -39,7 +39,7 @@ HERE
|
||||
|
||||
def test_self_field
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
Layout l = self.layout
|
||||
return 1
|
||||
@ -53,7 +53,7 @@ HERE
|
||||
|
||||
def test_message_field
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
Word name = message.name
|
||||
return name
|
||||
|
@ -6,7 +6,7 @@ class TestIfStatement < MiniTest::Test
|
||||
|
||||
def test_if_basicr
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
if_plus( 10 - 12)
|
||||
return 3
|
||||
@ -25,7 +25,7 @@ HERE
|
||||
|
||||
def test_if_small_minus
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
if_minus( 10 - 12)
|
||||
return 3
|
||||
@ -41,7 +41,7 @@ HERE
|
||||
|
||||
def test_if_small_zero
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
if_zero( 10 - 12)
|
||||
return 3
|
||||
|
@ -7,7 +7,7 @@ class TestReturnStatement < MiniTest::Test
|
||||
|
||||
def test_return_int
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
return 5
|
||||
end
|
||||
@ -19,7 +19,7 @@ HERE
|
||||
|
||||
def test_return_local
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int runner
|
||||
return runner
|
||||
@ -32,7 +32,7 @@ HERE
|
||||
|
||||
def test_return_local_assign
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int runner = 5
|
||||
return runner
|
||||
@ -46,7 +46,7 @@ HERE
|
||||
|
||||
def pest_return_space_length # need to add runtime first
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
|
||||
int main()
|
||||
Layout l = space.get_layout()
|
||||
@ -60,7 +60,7 @@ HERE
|
||||
|
||||
def test_return_call
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
return main()
|
||||
end
|
||||
|
@ -7,7 +7,7 @@ module Register
|
||||
|
||||
def test_while_mini
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
while_plus(1)
|
||||
return 3
|
||||
@ -22,7 +22,7 @@ HERE
|
||||
|
||||
def test_while_assign
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int n = 5
|
||||
while_plus(n)
|
||||
@ -41,7 +41,7 @@ HERE
|
||||
|
||||
def test_while_return
|
||||
@string_input = <<HERE
|
||||
class Object
|
||||
class Space
|
||||
int main()
|
||||
int n = 10
|
||||
while_plus( n - 5)
|
||||
|
Reference in New Issue
Block a user