summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/visitors/test_emitter.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/visitors/test_emitter.rb b/test/visitors/test_emitter.rb
index 6f19df9..e79a7b5 100644
--- a/test/visitors/test_emitter.rb
+++ b/test/visitors/test_emitter.rb
@@ -89,6 +89,21 @@ module Psych
assert_match(/key: value/, @io.string)
assert_equal @io.string, s.to_yaml
end
+
+ def test_alias
+ s = Nodes::Stream.new
+ doc = Nodes::Document.new
+ mapping = Nodes::Mapping.new
+ mapping.children << Nodes::Scalar.new('key', 'A')
+ mapping.children << Nodes::Alias.new('A')
+ doc.children << mapping
+ s.children << doc
+
+ @visitor.accept s
+
+ assert_match(/&A key: \*A/, @io.string)
+ assert_equal @io.string, s.to_yaml
+ end
end
end
end