diff options
author | Ben Bleything <ben@bleything.net> | 2006-09-12 17:14:00 +0000 |
---|---|---|
committer | Ben Bleything <ben@bleything.net> | 2006-09-12 17:14:00 +0000 |
commit | 15530c447c7252b586c99cf77c328295ad7a33c5 (patch) | |
tree | 9eca664d1054666e935cddd768327ba17f038655 | |
parent | 1a162b4b6ece664cde5ddc4c59b4fe4dce2b692f (diff) | |
download | plist-15530c447c7252b586c99cf77c328295ad7a33c5.tar.gz |
add test to expose bug in parser when handling comments in xml files
-rw-r--r-- | test/assets/commented.plist | 5 | ||||
-rw-r--r-- | test/test_parser.rb | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/assets/commented.plist b/test/assets/commented.plist new file mode 100644 index 0000000..f30ed9d --- /dev/null +++ b/test/assets/commented.plist @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<!-- I am a comment! --> +</plist> diff --git a/test/test_parser.rb b/test/test_parser.rb index 5aeda6c..ec18bfd 100644 --- a/test/test_parser.rb +++ b/test/test_parser.rb @@ -97,6 +97,12 @@ class TestPlist < Test::Unit::TestCase data = Plist::parse_xml(Plist::_xml('<string>Fish & Chips</string>')) assert_equal('Fish & Chips', data) end + + def test_comment_handling + assert_nothing_raised do + Plist::parse_xml( File.read('test/assets/commented.plist') ) + end + end end __END__ |