summaryrefslogtreecommitdiff
path: root/t/data
diff options
context:
space:
mode:
authorRuss Allbery <rra@cpan.org>2021-09-08 10:22:49 -0700
committerRuss Allbery <rra@cpan.org>2021-09-08 10:22:49 -0700
commite1ed1d4f0d86da79a4219508646be3e6b4879f4b (patch)
tree6038673b0977e9bd3b3aca3796da619518613c4a /t/data
parent5d0a957ed98045de3709f8e14796fecaf34e64fd (diff)
Move sitemap handling into its own module
Create App::DocKnot::Spin::Sitemap to handle sitemap parsing and output based on its contents and move the relevant code there from App::DocKnot::Spin.
Diffstat (limited to 't/data')
-rw-r--r--t/data/perlcriticrc6
-rw-r--r--t/data/spin/sitemap/complex147
-rw-r--r--t/data/spin/sitemap/complex.html168
-rw-r--r--t/data/spin/sitemap/invalid5
4 files changed, 323 insertions, 3 deletions
diff --git a/t/data/perlcriticrc b/t/data/perlcriticrc
index 4055f35..e60d616 100644
--- a/t/data/perlcriticrc
+++ b/t/data/perlcriticrc
@@ -71,9 +71,9 @@ allow = unless
[-Community::EmptyReturn]
[-Freenode::EmptyReturn]
-# The default of 9 is too small and forces weird code contortions.
-[InputOutput::RequireBriefOpen]
-lines = 40
+# The default of 9 is too small and forces weird code contortions. After some
+# experimentation, I've never found this helpful in driving useful refactors.
+[-InputOutput::RequireBriefOpen]
# This is correct 80% of the time, but it isn't correct for a lot of scripts
# inside packages, where maintaining $VERSION isn't worth the effort.
diff --git a/t/data/spin/sitemap/complex b/t/data/spin/sitemap/complex
new file mode 100644
index 0000000..c5282d5
--- /dev/null
+++ b/t/data/spin/sitemap/complex
@@ -0,0 +1,147 @@
+/: Russ Allbery
+# comments are ignored
+ /faqs/: FAQs and Documentation
+ /faqs/questions.html: Why Ask Questions in Public?
+ ---
+ /faqs/comments.html: Why This Journal Doesn't Support Comments
+ ---
+ /faqs/big-eight.html: Big Eight Newsgroup Creation Process
+ ---
+ /faqs/mod-pitfalls.html: Pitfalls of Moderation
+ ---
+ /faqs/usenet-hier.html: Usenet Hierarchy Administration
+ ---
+ /faqs/racc.html: rec.arts.comics.creative FAQ
+ ---
+ /faqs/rgra.html: rec.games.roguelike.announce Posting Guidelines
+ ---
+ /faqs/inn.html: INN 2.x FAQ
+ ---
+ /faqs/soundness-inn.html: Soundness for INN
+ /faqs/soundness-cnews.html: Soundness for C News
+ /faqs/soundness-other.html: Soundness for Other Servers
+ ---
+ /faqs/mjqmail.html: Using Majordomo with qmail
+ /notes/: Technical Notes
+ /notes/afs/: AFS
+ /notes/afs/afsdb.html: AFS Reporting Database
+ /notes/afs/balance.html: AFS Server Balancing
+ /notes/style/: Coding Style
+ /notes/style/build.html: Build System Style
+ /notes/style/doc.html: Package Documentation Style
+ /notes/style/c.html: C Coding Style
+ /notes/style/perl.html: Perl Coding Style
+ /notes/cvs/: CVS
+ /notes/cvs/overview.html: Overview of CVS
+ /notes/cvs/why.html: Why put a set of files into CVS?
+ /notes/cvs/basic-usage.html: Basic CVS usage
+ /notes/cvs/command-summary.html: Short CVS command summary
+ /notes/cvs/emacs.html: Using CVS inside emacs
+ /notes/cvs/cvsignore.html: Telling CVS to ignore files
+ /notes/cvs/renaming-files.html: Renaming in CVS
+ /notes/cvs/revisions.html: CVS revision numbers
+ /notes/cvs/conflicts.html: Resolving CVS conflicts
+ /notes/cvs/import.html: Tracking vendor source
+ /notes/cvs/tagging-branching.html: Tagging and branching
+ /notes/cvs/aliases.html: tcsh aliases for CVS
+ /notes/cvs/file-headers.html: CVS keywords in file headers
+ /notes/debian/: Debian
+ /notes/debian/server.html: Debian Best Practices
+ /notes/debian/private-repo.html: Debian Private Repositories
+ /notes/debian/build-tools.html: Debian Packaging Tools
+ /notes/debian/git.html: Using Git for Debian
+ /notes/debian/scripts.html: Packaging Scripts for Debian
+ /notes/debian/sbuild.html: sbuild with btrfs
+ /notes/debian/firebird.html: Debian on HP Firebird 802
+ /notes/debian/shuttle.html: Debian on Shuttle SN85G4
+ /notes/debian/jce-policy.html: Java JCE Policy Packaging
+ /notes/debian/kernel-build.html: Debian Kernel Build
+ /notes/debian/qmail.html: qmail on Debian
+ /notes/debian/quotas.html: Enabling Quotas on Debian
+ /notes/kerberos/: Kerberos
+ /notes/perl-sig.html: Perl Signature Quine
+ /notes/languages/: Programming Languages
+ /notes/languages/background.html: Programming Background
+ ---
+ /notes/languages/python.html: Notes on Python
+ /notes/languages/java.html: Notes on Java
+ /notes/xemacs-mt.html: XEmacs and Movable Type
+ /notes/scrum/: Scrum
+ /notes/rpath.html: Shared Library Search Paths
+ /notes/puppet.html: Small-Scale Puppet
+ /notes/bundle.html: System Templating with Bundle
+ /notes/solaris/: Solaris
+ /notes/solaris/dns-cache.html: Flushing nscd's Cache
+ /notes/solaris/setuid-core.html: setuid Core Dumps
+ /notes/solaris/boot-disk.html: Swapping Boot Disks
+ /notes/solaris/ipv6.html: Minimal IPv6 Setup
+ /notes/solaris/swap-file.html: Adding a Swap File
+ /notes/xhtml.html: XHTML
+ /stories/: Stories
+ /stories/drifter.html: Drifter
+ /stories/drifter.01.html: Drifter #1
+ /stories/drifter.02.html: Drifter #2
+ /stories/drifter.03.html: Drifter #3
+ /stories/drifter.04.html: Drifter #4
+ /stories/drifter.05.html: Drifter #5
+ /stories/drifter.special.html: Drifter RACC Vote Special
+ /stories/retcon.html: Retcon Midnight
+ /stories/retcon.intro.html: Introduction
+ /stories/retcon.prologue.html: Prologue
+ /stories/retcon.01.html: Retcon Midnight #1
+ /stories/retcon.02.html: Retcon Midnight #2
+ /stories/retcon.03.html: Retcon Midnight #3
+ /stories/retcon.04.html: Retcon Midnight #4
+ /stories/retcon.05.html: Retcon Midnight #5
+ /stories/retcon.source.html: Retcon Midnight Sourcebook
+ /stories/birds.fly.html: Birds Fly
+ /stories/birds.fly.01.html: Birds Fly #1
+ /stories/birds.fly.02.html: Birds Fly #2
+ /stories/birds.fly.03.html: Birds Fly #3
+ /stories/perspectives.html: Perspectives
+ /stories/perspectives.01.html: Perspectives #1
+ /stories/perspectives.02.html: Perspectives #2
+ ---
+ /writing/: Other Writing
+ /writing/rant.html: A Rant About Usenet
+ ---
+ /writing/community.html: On Community
+ ---
+ /writing/homesteading.html: Comments on Homesteading the Noosphere
+ ---
+ /writing/terrorism.html: Terrorism and War
+ ---
+ /writing/defiantly.html: Defiantly Free
+ /usefor/: Usenet Format and Protocols
+ /usefor/rfcs/: Netnews Standards
+ /usefor/drafts/: Netnews Drafts
+ /nntp/: NNTP
+ /nntp/rfcs/: NNTP Standards
+ /nntp/drafts/: NNTP Drafts
+ ---
+ /nntp/ietf.html: IETF nntpext WG
+ /big-8/: Big Eight Hierarchy
+ /personal/: Personal Information
+ /personal/contact.html: Contact Information
+ ---
+ /personal/projects.html: Current Projects
+ /links/: Links
+ /links/books.html: Books
+ /links/charities.html: Charities and Non-Profits
+ /links/people.html: Interesting People
+ /links/vendors.html: On-Line Stores and Vendors
+ /changes.html: Recent Changes
+ /changes/2020.html: 2020 Changes
+ /changes/2019.html: 2019 Changes
+ /changes/2018.html: 2018 Changes
+ /changes/2017.html: 2017 Changes
+ /changes/2016.html: 2016 Changes
+ /changes/2015.html: 2015 Changes
+ /changes/2014.html: 2014 Changes
+ /changes/2013.html: 2013 Changes
+ /changes/2012.html: 2012 Changes
+ /changes/2011.html: 2011 Changes
+ /changes/2010.html: 2010 Changes
+ /changes/2009.html: 2009 Changes
+ /changes/2008.html: 2008 Changes
+ /sitemap.html: Sitemap
diff --git a/t/data/spin/sitemap/complex.html b/t/data/spin/sitemap/complex.html
new file mode 100644
index 0000000..45832db
--- /dev/null
+++ b/t/data/spin/sitemap/complex.html
@@ -0,0 +1,168 @@
+ <ul>
+ <li><a href="faqs/">FAQs and Documentation</a></li>
+ <ul>
+ <li><a href="faqs/questions.html">Why Ask Questions in Public?</a></li>
+ <li><a href="faqs/comments.html">Why This Journal Doesn't Support Comments</a></li>
+ <li><a href="faqs/big-eight.html">Big Eight Newsgroup Creation Process</a></li>
+ <li><a href="faqs/mod-pitfalls.html">Pitfalls of Moderation</a></li>
+ <li><a href="faqs/usenet-hier.html">Usenet Hierarchy Administration</a></li>
+ <li><a href="faqs/racc.html">rec.arts.comics.creative FAQ</a></li>
+ <li><a href="faqs/rgra.html">rec.games.roguelike.announce Posting Guidelines</a></li>
+ <li><a href="faqs/inn.html">INN 2.x FAQ</a></li>
+ <li><a href="faqs/soundness-inn.html">Soundness for INN</a></li>
+ <li><a href="faqs/soundness-cnews.html">Soundness for C News</a></li>
+ <li><a href="faqs/soundness-other.html">Soundness for Other Servers</a></li>
+ <li><a href="faqs/mjqmail.html">Using Majordomo with qmail</a></li>
+ </ul>
+ <li><a href="notes/">Technical Notes</a></li>
+ <ul>
+ <li><a href="notes/afs/">AFS</a></li>
+ <ul>
+ <li><a href="notes/afs/afsdb.html">AFS Reporting Database</a></li>
+ <li><a href="notes/afs/balance.html">AFS Server Balancing</a></li>
+ </ul>
+ <li><a href="notes/style/">Coding Style</a></li>
+ <ul>
+ <li><a href="notes/style/build.html">Build System Style</a></li>
+ <li><a href="notes/style/doc.html">Package Documentation Style</a></li>
+ <li><a href="notes/style/c.html">C Coding Style</a></li>
+ <li><a href="notes/style/perl.html">Perl Coding Style</a></li>
+ </ul>
+ <li><a href="notes/cvs/">CVS</a></li>
+ <ul>
+ <li><a href="notes/cvs/overview.html">Overview of CVS</a></li>
+ <li><a href="notes/cvs/why.html">Why put a set of files into CVS?</a></li>
+ <li><a href="notes/cvs/basic-usage.html">Basic CVS usage</a></li>
+ <li><a href="notes/cvs/command-summary.html">Short CVS command summary</a></li>
+ <li><a href="notes/cvs/emacs.html">Using CVS inside emacs</a></li>
+ <li><a href="notes/cvs/cvsignore.html">Telling CVS to ignore files</a></li>
+ <li><a href="notes/cvs/renaming-files.html">Renaming in CVS</a></li>
+ <li><a href="notes/cvs/revisions.html">CVS revision numbers</a></li>
+ <li><a href="notes/cvs/conflicts.html">Resolving CVS conflicts</a></li>
+ <li><a href="notes/cvs/import.html">Tracking vendor source</a></li>
+ <li><a href="notes/cvs/tagging-branching.html">Tagging and branching</a></li>
+ <li><a href="notes/cvs/aliases.html">tcsh aliases for CVS</a></li>
+ <li><a href="notes/cvs/file-headers.html">CVS keywords in file headers</a></li>
+ </ul>
+ <li><a href="notes/debian/">Debian</a></li>
+ <ul>
+ <li><a href="notes/debian/server.html">Debian Best Practices</a></li>
+ <li><a href="notes/debian/private-repo.html">Debian Private Repositories</a></li>
+ <li><a href="notes/debian/build-tools.html">Debian Packaging Tools</a></li>
+ <li><a href="notes/debian/git.html">Using Git for Debian</a></li>
+ <li><a href="notes/debian/scripts.html">Packaging Scripts for Debian</a></li>
+ <li><a href="notes/debian/sbuild.html">sbuild with btrfs</a></li>
+ <li><a href="notes/debian/firebird.html">Debian on HP Firebird 802</a></li>
+ <li><a href="notes/debian/shuttle.html">Debian on Shuttle SN85G4</a></li>
+ <li><a href="notes/debian/jce-policy.html">Java JCE Policy Packaging</a></li>
+ <li><a href="notes/debian/kernel-build.html">Debian Kernel Build</a></li>
+ <li><a href="notes/debian/qmail.html">qmail on Debian</a></li>
+ <li><a href="notes/debian/quotas.html">Enabling Quotas on Debian</a></li>
+ </ul>
+ <li><a href="notes/kerberos/">Kerberos</a></li>
+ <li><a href="notes/perl-sig.html">Perl Signature Quine</a></li>
+ <li><a href="notes/languages/">Programming Languages</a></li>
+ <ul>
+ <li><a href="notes/languages/background.html">Programming Background</a></li>
+ <li><a href="notes/languages/python.html">Notes on Python</a></li>
+ <li><a href="notes/languages/java.html">Notes on Java</a></li>
+ </ul>
+ <li><a href="notes/xemacs-mt.html">XEmacs and Movable Type</a></li>
+ <li><a href="notes/scrum/">Scrum</a></li>
+ <li><a href="notes/rpath.html">Shared Library Search Paths</a></li>
+ <li><a href="notes/puppet.html">Small-Scale Puppet</a></li>
+ <li><a href="notes/bundle.html">System Templating with Bundle</a></li>
+ <li><a href="notes/solaris/">Solaris</a></li>
+ <ul>
+ <li><a href="notes/solaris/dns-cache.html">Flushing nscd's Cache</a></li>
+ <li><a href="notes/solaris/setuid-core.html">setuid Core Dumps</a></li>
+ <li><a href="notes/solaris/boot-disk.html">Swapping Boot Disks</a></li>
+ <li><a href="notes/solaris/ipv6.html">Minimal IPv6 Setup</a></li>
+ <li><a href="notes/solaris/swap-file.html">Adding a Swap File</a></li>
+ </ul>
+ <li><a href="notes/xhtml.html">XHTML</a></li>
+ </ul>
+ <li><a href="stories/">Stories</a></li>
+ <ul>
+ <li><a href="stories/drifter.html">Drifter</a></li>
+ <ul>
+ <li><a href="stories/drifter.01.html">Drifter #1</a></li>
+ <li><a href="stories/drifter.02.html">Drifter #2</a></li>
+ <li><a href="stories/drifter.03.html">Drifter #3</a></li>
+ <li><a href="stories/drifter.04.html">Drifter #4</a></li>
+ <li><a href="stories/drifter.05.html">Drifter #5</a></li>
+ <li><a href="stories/drifter.special.html">Drifter RACC Vote Special</a></li>
+ </ul>
+ <li><a href="stories/retcon.html">Retcon Midnight</a></li>
+ <ul>
+ <li><a href="stories/retcon.intro.html">Introduction</a></li>
+ <li><a href="stories/retcon.prologue.html">Prologue</a></li>
+ <li><a href="stories/retcon.01.html">Retcon Midnight #1</a></li>
+ <li><a href="stories/retcon.02.html">Retcon Midnight #2</a></li>
+ <li><a href="stories/retcon.03.html">Retcon Midnight #3</a></li>
+ <li><a href="stories/retcon.04.html">Retcon Midnight #4</a></li>
+ <li><a href="stories/retcon.05.html">Retcon Midnight #5</a></li>
+ <li><a href="stories/retcon.source.html">Retcon Midnight Sourcebook</a></li>
+ </ul>
+ <li><a href="stories/birds.fly.html">Birds Fly</a></li>
+ <ul>
+ <li><a href="stories/birds.fly.01.html">Birds Fly #1</a></li>
+ <li><a href="stories/birds.fly.02.html">Birds Fly #2</a></li>
+ <li><a href="stories/birds.fly.03.html">Birds Fly #3</a></li>
+ </ul>
+ <li><a href="stories/perspectives.html">Perspectives</a></li>
+ <ul>
+ <li><a href="stories/perspectives.01.html">Perspectives #1</a></li>
+ <li><a href="stories/perspectives.02.html">Perspectives #2</a></li>
+ </ul>
+ </ul>
+ <li><a href="writing/">Other Writing</a></li>
+ <ul>
+ <li><a href="writing/rant.html">A Rant About Usenet</a></li>
+ <li><a href="writing/community.html">On Community</a></li>
+ <li><a href="writing/homesteading.html">Comments on Homesteading the Noosphere</a></li>
+ <li><a href="writing/terrorism.html">Terrorism and War</a></li>
+ <li><a href="writing/defiantly.html">Defiantly Free</a></li>
+ </ul>
+ <li><a href="usefor/">Usenet Format and Protocols</a></li>
+ <ul>
+ <li><a href="usefor/rfcs/">Netnews Standards</a></li>
+ <li><a href="usefor/drafts/">Netnews Drafts</a></li>
+ </ul>
+ <li><a href="nntp/">NNTP</a></li>
+ <ul>
+ <li><a href="nntp/rfcs/">NNTP Standards</a></li>
+ <li><a href="nntp/drafts/">NNTP Drafts</a></li>
+ <li><a href="nntp/ietf.html">IETF nntpext WG</a></li>
+ </ul>
+ <li><a href="big-8/">Big Eight Hierarchy</a></li>
+ <li><a href="personal/">Personal Information</a></li>
+ <ul>
+ <li><a href="personal/contact.html">Contact Information</a></li>
+ <li><a href="personal/projects.html">Current Projects</a></li>
+ </ul>
+ <li><a href="links/">Links</a></li>
+ <ul>
+ <li><a href="links/books.html">Books</a></li>
+ <li><a href="links/charities.html">Charities and Non-Profits</a></li>
+ <li><a href="links/people.html">Interesting People</a></li>
+ <li><a href="links/vendors.html">On-Line Stores and Vendors</a></li>
+ </ul>
+ <li><a href="changes.html">Recent Changes</a></li>
+ <ul>
+ <li><a href="changes/2020.html">2020 Changes</a></li>
+ <li><a href="changes/2019.html">2019 Changes</a></li>
+ <li><a href="changes/2018.html">2018 Changes</a></li>
+ <li><a href="changes/2017.html">2017 Changes</a></li>
+ <li><a href="changes/2016.html">2016 Changes</a></li>
+ <li><a href="changes/2015.html">2015 Changes</a></li>
+ <li><a href="changes/2014.html">2014 Changes</a></li>
+ <li><a href="changes/2013.html">2013 Changes</a></li>
+ <li><a href="changes/2012.html">2012 Changes</a></li>
+ <li><a href="changes/2011.html">2011 Changes</a></li>
+ <li><a href="changes/2010.html">2010 Changes</a></li>
+ <li><a href="changes/2009.html">2009 Changes</a></li>
+ <li><a href="changes/2008.html">2008 Changes</a></li>
+ </ul>
+ <li><a href="sitemap.html">Sitemap</a></li>
+ </ul>
diff --git a/t/data/spin/sitemap/invalid b/t/data/spin/sitemap/invalid
new file mode 100644
index 0000000..e27abec
--- /dev/null
+++ b/t/data/spin/sitemap/invalid
@@ -0,0 +1,5 @@
+/: Russ Allbery
+ /faqs/: FAQs and Documentation
+ /faqs/questions.html
+ ---
+ /faqs/comments.html: Why This Journal Doesn't Support Comments