From 00600d536475590a3ef5a83e862564ad2478ac17 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 27 Aug 2015 21:01:30 +0300 Subject: [PATCH] mostly not working tests yet --- test/unit/test_basic.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/unit/test_basic.rb b/test/unit/test_basic.rb index e780a1f..adf9fb8 100644 --- a/test/unit/test_basic.rb +++ b/test/unit/test_basic.rb @@ -8,64 +8,64 @@ class TestBasic < MiniTest::Test @string_input = 'true ' @parse_output = {:true => 'true'} @transform_output = Ast::TrueExpression.new() - @parser = @parser.basic_type + @root = :keyword_true end - def test_false + def ttest_false @string_input = 'false ' @parse_output = {:false => 'false'} @transform_output = Ast::FalseExpression.new() @parser = @parser.basic_type end - def test_nil + def ttest_nil @string_input = 'nil ' @parse_output = {:nil => 'nil'} @transform_output = Ast::NilExpression.new() @parser = @parser.basic_type end - def test_number + def ttest_number @string_input = '42 ' @parse_output = {:integer => '42'} @transform_output = Ast::IntegerExpression.new(42) @parser = @parser.integer end - def test_name + def ttest_name @string_input = 'foo ' @parse_output = {:name => 'foo'} @transform_output = Ast::NameExpression.new('foo') @parser = @parser.name end - def test_name_underscode_start + def ttest_name_underscode_start @string_input = '_bar ' @parse_output = {:name => '_bar'} @transform_output = Ast::NameExpression.new('_bar') @parser = @parser.name end - def test_name_underscode_middle + def ttest_name_underscode_middle @string_input = 'foo_bar ' @parse_output = {:name => 'foo_bar'} @transform_output = Ast::NameExpression.new('foo_bar') @parser = @parser.name end - def test_instance_variable + def ttest_instance_variable @string_input = '@foo_bar ' @parse_output = {:instance_variable=>{:name=>"foo_bar"}} @transform_output = Ast::VariableExpression.new(:foo_bar) @parser = @parser.instance_variable end - def test_module_name + def ttest_module_name @string_input = 'FooBar ' @parse_output = {:module_name=>"FooBar"} @transform_output = Ast::ModuleName.new("FooBar") @parser = @parser.module_name end - def test_comment + def ttest_comment out = "# i am a comment \n" @string_input = out.dup #NEEDS the return, which is what delimits the comment @parse_output = out @@ -73,20 +73,20 @@ class TestBasic < MiniTest::Test @parser = @parser.comment end - def test_string + def ttest_string @string_input = "\"hello\"" @parse_output = {:string=>[{:char=>"h"}, {:char=>"e"}, {:char=>"l"}, {:char=>"l"}, {:char=>"o"}]} @transform_output = Ast::StringExpression.new('hello') @parser = @parser.string end - def test_string_escapes + def ttest_string_escapes out = 'hello \nyou' @string_input = '"' + out + '"' - @parse_output = {:string=>[{:char=>"h"}, {:char=>"e"}, {:char=>"l"}, {:char=>"l"}, {:char=>"o"}, + @parse_output = {:string=>[{:char=>"h"}, {:char=>"e"}, {:char=>"l"}, {:char=>"l"}, {:char=>"o"}, {:char=>" "}, {:char=>" "}, {:esc=>"n"}, {:char=>"y"}, {:char=>"o"}, {:char=>"u"}]} @transform_output = Ast::StringExpression.new(out) @parser = @parser.string end -end \ No newline at end of file +end