aboutsummaryrefslogtreecommitdiffstats
path: root/test/psych/test_parser.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-28 22:24:01 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-28 22:24:01 +0000
commit75cff1d7d079ebcd7688341cf80bba6d647fd331 (patch)
treee789979f08179a25a325689c9cc56c3e448c092c /test/psych/test_parser.rb
parent874acd73476420e9b1bc0d63c292d772d1aa55d3 (diff)
downloadruby-75cff1d7d079ebcd7688341cf80bba6d647fd331.tar.gz
add a test for yaml ast roundtripping
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_parser.rb')
-rw-r--r--test/psych/test_parser.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb
index d8c53f2d0d..acbdd96f5c 100644
--- a/test/psych/test_parser.rb
+++ b/test/psych/test_parser.rb
@@ -32,6 +32,13 @@ module Psych
@handler.parser = @parser
end
+ def test_ast_roundtrip
+ parser = Psych.parser
+ parser.parse('null')
+ ast = parser.handler.root
+ assert_match(/^null/, ast.yaml)
+ end
+
def test_exception_memory_leak
yaml = <<-eoyaml
%YAML 1.1