Browse Source

Date tests

master
J. King 4 years ago
parent
commit
1b77d53d70
  1. 17
      tests/cases/XML/entry-atom.yaml
  2. 23
      tests/cases/XML/entry-mixed.yaml
  3. 31
      tests/cases/XML/entry-rss1.yaml
  4. 23
      tests/cases/XML/entry-rss2.yaml

17
tests/cases/XML/entry-atom.yaml

@ -94,3 +94,20 @@ Related link:
- relatedLink: 'http://example.com/'
- relatedLink: 'http://example.com/'
- relatedLink: 'http://example.com/'
Creation and update dates:
input: >
<feed xmlns="http://www.w3.org/2005/Atom">
<entry>
<created>2020-01-01T00:00:00Z</created>
<created>2020-03-03T00:00:00Z</created>
<updated>2020-03-03T00:00:00Z</updated>
<updated>2020-04-01T00:00:00Z</updated>
</entry>
</feed>
output:
format: atom
version: '1.0'
entries:
- dateCreated: '2020-01-01T00:00:00Z'
dateModified: '2020-04-01T00:00:00Z'

23
tests/cases/XML/entry-mixed.yaml

@ -16,3 +16,26 @@ Atom related link in RSS 2.0: # A reliable related link overrides the RSS 2.0 gu
- id: 'http://example.com/'
link: 'http://example.org/'
relatedLink: 'http://example.net/'
Update and creation dates:
input: >
<rss><channel xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<item>
<pubDate>2020-03-03T00:00:00Z</pubDate>
</item>
<item>
<atom:created>2020-03-03T00:00:00Z</atom:created>
<lastBuildDate>2020-01-01T00:00:00Z</lastBuildDate>
</item>
<item>
<dc:date>2020-03-03T01:00:00+01:00</dc:date>
<pubDate>2020-03-03T00:00:00Z</pubDate>
</item>
</channel></rss>
output:
format: rss
entries:
- dateModified: '2020-03-03T00:00:00Z'
- dateCreated: '2020-03-03T00:00:00Z'
dateModified: '2020-01-01T00:00:00Z'
- dateModified: '2020-03-03T01:00:00+01:00'

31
tests/cases/XML/entry-rss1.yaml

@ -55,8 +55,8 @@ Dublin Core language:
Entry link:
input: >
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<item rdf:about="blah">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/">
<item>
<link>http://example.com/</link>
</item>
</rdf:RDF>
@ -64,5 +64,28 @@ Entry link:
format: rdf
version: '1.0'
entries:
- id: blah
link: 'http://example.com/'
- link: 'http://example.com/'
Dublin Core dates:
input: >
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<item>
<dc:date>2020-03-03T00:00:00Z</dc:date>
</item>
<item>
<dc:date>2020-03-03T00:00:00Z</dc:date>
<dc:date>2020-01-01T00:00:00Z</dc:date>
</item>
<item>
<dc:date>2020-03-03T01:00:00+01:00</dc:date>
<dc:date>2020-03-03T00:00:00Z</dc:date>
</item>
</rdf:RDF>
output:
format: rdf
version: '1.0'
entries:
- dateModified: '2020-03-03T00:00:00Z'
- dateCreated: '2020-01-01T00:00:00Z'
dateModified: '2020-03-03T00:00:00Z'
- dateModified: '2020-03-03T01:00:00+01:00'

23
tests/cases/XML/entry-rss2.yaml

@ -93,3 +93,26 @@ Related link:
link: 'http://example.com/'
- id: 'http://example.com/'
link: 'http://example.com/blah'
Update and creation dates:
input: >
<rss><channel>
<item>
<pubDate>2020-03-03T00:00:00Z</pubDate>
</item>
<item>
<pubDate>2020-03-03T00:00:00Z</pubDate>
<lastBuildDate>2020-01-01T00:00:00Z</lastBuildDate>
</item>
<item>
<pubDate>2020-03-03T01:00:00+01:00</pubDate>
<pubDate>2020-03-03T00:00:00Z</pubDate>
</item>
</channel></rss>
output:
format: rss
entries:
- dateModified: '2020-03-03T00:00:00Z'
- dateCreated: '2020-01-01T00:00:00Z'
dateModified: '2020-03-03T00:00:00Z'
- dateModified: '2020-03-03T01:00:00+01:00'

Loading…
Cancel
Save