test/test_compile.rb in scottkit-1.5.0 vs test/test_compile.rb in scottkit-1.6.0
- old
+ new
@@ -21,34 +21,34 @@
[ :eof ],
];
def test_lexer
game = ScottKit::Game.new({})
- lexer = ScottKit::Game::Compiler::Lexer.new(game, "data/tutorial/t1.sck")
+ lexer = ScottKit::Game::Compiler::Lexer.new(game, "games/tutorial/t1.sck")
EXPECTED.each do |x| token, lexeme = *x
got = lexer.lex
assert_equal(token, got)
assert_equal(lexeme, lexer.lexeme) if lexeme
end
end
def test_parser
game = ScottKit::Game.new({})
# It's a clumsy API, but then we're peeking where we're not invited
- compiler = ScottKit::Game::Compiler.new(game, "data/tutorial/t6.sck")
+ compiler = ScottKit::Game::Compiler.new(game, "games/test/t6.sck")
tree = compiler.parse
got = tree.pretty_inspect
- expected = File.read("data/test/t6.pretty-print")
+ expected = File.read("games/test/t6.pretty-print")
# Remove hex object addresses from pretty-printed trees
assert_equal(got.gsub(/0x\h+/, ""), expected.gsub(/0x\h+/, ""))
end
def test_code_generator
game = ScottKit::Game.new({})
f = StringIO.new
withIO(nil, f) do
- game.compile_to_stdout("data/test/crystal.sck") or
+ game.compile_to_stdout("games/test/crystal.sck") or
raise "couldn't compile crystal.sck"
end
- assert_equal(f.string, File.read("data/test/crystal.sao"))
+ assert_equal(f.string, File.read("games/test/crystal.sao"))
end
end