--- /dev/null
+#!perl -w
+
+use strict;
+use strict;
+use Test::More tests => 8 * 3;
+use XML::Feed;
+
+foreach my $test (["atom"], ["rss", "subjects"], ["rss"]) {
+
+ my $type = $test->[0];
+ my $other = ('Atom' ne $type)? "RSS" : "RSS";
+ my $field = $test->[1] || "categories";
+ my $sing = ("categories" eq $field)? "category" : "subject";
+
+ ok(my $feed = XML::Feed->parse("t/samples/${type}-multiple-${field}.xml"), "Parsed $type file with multiple $field");
+ my ($entry) = $feed->entries;
+
+ is_deeply(
+ [$entry->category()],
+ ["foo", "bar", "quux", "simon's tags"],
+ "Got all $field");
+
+ my $xml = $feed->as_xml;
+ ok($feed = XML::Feed->parse(\$xml), "Reparsed $type from string");
+ is_deeply(
+ [$entry->category()],
+ ["foo", "bar", "quux", "simon's tags"],
+ "Got all $field again");
+
+ ok($entry->category("quirka fleeg"), "Added a $sing");
+ is_deeply(
+ [$entry->category()],
+ ["foo", "bar", "quux", "simon's tags", "quirka fleeg"],
+ "Got new $sing");
+
+ ok(my $new = $entry->convert($other), "Converted entry to $other");
+ is_deeply(
+ [$new->category()],
+ ["foo", "bar", "quux", "simon's tags", "quirka fleeg"],
+ "Got converted $field");
+
+}