Skip to content

Commit 05401da

Browse files
committed
Test that the syntax tree is marshalable
1 parent 9663fec commit 05401da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/syntax_tree_test.rb

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def test_parse_error
2929
assert_raises(Parser::ParseError) { SyntaxTree.parse("<>") }
3030
end
3131

32+
def test_marshalable
33+
node = SyntaxTree.parse("1 + 2")
34+
assert_operator(node, :===, Marshal.load(Marshal.dump(node)))
35+
end
36+
3237
def test_maxwidth_format
3338
assert_equal("foo +\n bar\n", SyntaxTree.format("foo + bar", 5))
3439
end

0 commit comments

Comments
 (0)