summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/cli/generate.t8
-rw-r--r--t/data/generate/docknot/output/thread10
-rwxr-xr-xt/data/regenerate-data4
-rw-r--r--t/data/spin/output/usefor/index.html2
-rwxr-xr-xt/docs/spdx-license.t4
-rwxr-xr-xt/update/spin.t22
6 files changed, 24 insertions, 26 deletions
diff --git a/t/cli/generate.t b/t/cli/generate.t
index f3d37f3..7d4b766 100755
--- a/t/cli/generate.t
+++ b/t/cli/generate.t
@@ -29,15 +29,12 @@ BEGIN { use_ok('App::DocKnot::Command') }
my $docknot = App::DocKnot::Command->new();
isa_ok($docknot, 'App::DocKnot::Command');
-# Create a temporary directory for test output.
-my $tempdir = Path::Tiny->tempdir();
-
# Generate the package README file to a temporary file, read it into memory,
# and compare it to the actual README file. This duplicates part of the
# generate/self.t test, but via the command-line parser. Do this in a
# separate block so that $tempfile goes out of scope and will be cleaned up.
{
- my $tempfile = $tempdir->tempfile();
+ my $tempfile = Path::Tiny->tempfile();
$docknot->run('generate', 'readme', "$tempfile");
my $output = $tempfile->slurp_utf8();
is_file_contents($output, 'README', 'Generated README from argument list');
@@ -45,7 +42,7 @@ my $tempdir = Path::Tiny->tempdir();
# Do the same thing again, but using arguments from @ARGV.
{
- my $tempfile = $tempdir->tempfile();
+ my $tempfile = Path::Tiny->tempfile();
local @ARGV = ('generate', 'readme-md', "$tempfile");
$docknot->run();
my $output = $tempfile->slurp_utf8();
@@ -59,6 +56,7 @@ my $metadata_path = path('docs', 'docknot.yaml')->realpath();
# Generate all of the files using generate-all in a new temporary directory.
my $cwd = getcwd();
+my $tempdir = Path::Tiny->tempdir();
chdir($tempdir);
$docknot->run('generate-all', '-m', "$metadata_path");
my $output = path('README')->slurp_utf8();
diff --git a/t/data/generate/docknot/output/thread b/t/data/generate/docknot/output/thread
index 5f49a3e..8ef3cfa 100644
--- a/t/data/generate/docknot/output/thread
+++ b/t/data/generate/docknot/output/thread
@@ -32,7 +32,7 @@
\h2[Download]
\download[DocKnot][docknot]
- [devel/App-DocKnot-\version[docknot]]
+ [web/App-DocKnot-\version[docknot]]
\link[https://packages.debian.org/source/sid/docknot]
[Debian packages] \break
@@ -52,7 +52,7 @@
[GitHub] \break
\link[https://github.com/rra/docknot/issues]
[Bug tracker] \break
- \link[https://git.eyrie.org/?p=devel/docknot.git]
+ \link[https://git.eyrie.org/?p=web/docknot.git]
[Git repository] \break
\link[https://metacpan.org/release/App-DocKnot]
[MetaCPAN] \break
@@ -131,7 +131,7 @@ The distribution:
\table[][
\program[DocKnot][docknot]
- [devel/App-DocKnot-\version[docknot]]
+ [web/App-DocKnot-\version[docknot]]
]
An \link[https://archives.eyrie.org/software/ARCHIVE/App-DocKnot/]
@@ -149,10 +149,10 @@ DocKnot is maintained using the Git version control system. To check out
the current development tree, see
\link[https://github.com/rra/docknot][GitHub] or clone:
-\pre[ https://git.eyrie.org/git/devel/docknot.git]
+\pre[ https://git.eyrie.org/git/web/docknot.git]
Pull requests on GitHub are welcome. You can also
-\link[https://git.eyrie.org/?p=devel/docknot.git][browse the current
+\link[https://git.eyrie.org/?p=web/docknot.git][browse the current
development source].
\h2[Documentation]
diff --git a/t/data/regenerate-data b/t/data/regenerate-data
index f796f8f..ac93310 100755
--- a/t/data/regenerate-data
+++ b/t/data/regenerate-data
@@ -43,6 +43,10 @@ for my $package (@packages) {
}
}
+# Regenerate the README and README.md for DocKnot itself.
+my $docknot = App::DocKnot::Generate->new();
+$docknot->generate_all();
+
# The test of spinning a tree of files uses a reference to App::DocKnot's own
# POD documentation. Regenerate the expected output in case the POD has
# changed.
diff --git a/t/data/spin/output/usefor/index.html b/t/data/spin/output/usefor/index.html
index 964c216..be5cda5 100644
--- a/t/data/spin/output/usefor/index.html
+++ b/t/data/spin/output/usefor/index.html
@@ -88,7 +88,7 @@ interest:
</p>
<ul>
-<li class="packed"><a href="drafts/draft-ietf-usefor-useage-01.txt">Usenet Best Practice</a> (2KB)</li>
+<li class="packed"><a href="drafts/draft-ietf-usefor-useage-01.txt">Usenet Best Practice</a> (2KiB)</li>
<li class="packed"><a href="drafts/draft-ietf-usefor-message-id-01.txt">Recommendations for Generating Message IDs</a> (215B)</li>
<li class="packed"><a href="drafts/draft-ietf-usefor-posted-mailed-01.txt">Identification of Messages Delivered Via Both Mail and News</a> (215B)</li>
<li class="packed"><a href="drafts/draft-lindsey-usefor-signed-01.txt">Signed Headers in Mail and Netnews</a> (215B)</li>
diff --git a/t/docs/spdx-license.t b/t/docs/spdx-license.t
index 15ee7e0..0a0fae4 100755
--- a/t/docs/spdx-license.t
+++ b/t/docs/spdx-license.t
@@ -9,7 +9,7 @@
# The canonical version of this file is maintained in the rra-c-util package,
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
-# Copyright 2018-2021 Russ Allbery <eagle@eyrie.org>
+# Copyright 2018-2022 Russ Allbery <eagle@eyrie.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@@ -121,7 +121,7 @@ sub check_file {
close($file) or BAIL_OUT("Cannot close $path");
# If there is a legacy license notice, report a failure regardless of file
- # size. Otherwise, skip files under 1KB. They can be rolled up into the
+ # size. Otherwise, skip files under 1KiB. They can be rolled up into the
# overall project license and the license notice may be a substantial
# portion of the file size.
if ($saw_legacy_notice) {
diff --git a/t/update/spin.t b/t/update/spin.t
index c692c80..d2bbc5a 100755
--- a/t/update/spin.t
+++ b/t/update/spin.t
@@ -46,20 +46,16 @@ $update->update_spin($tempdir);
# Check the resulting output.
my $expected = path('t', 'data', 'spin', 'update', 'output');
my $count = is_spin_output_tree("$tempdir", "$expected", 'Tree updated');
-my @changes = grep { m{ deleted | new [ ] file }xms } $repo->run('status');
-@changes = map { [split(q{ })] } sort(@changes);
-is_deeply(
- \@changes,
- [
- ['deleted:', 'module.rpod'],
- ['deleted:', 'readme.rpod'],
- ['deleted:', 'script.rpod'],
- ['new', 'file:', 'module.spin'],
- ['new', 'file:', 'readme.spin'],
- ['new', 'file:', 'script.spin'],
- ],
- 'Git operations',
+my @status = sort $repo->run('status', '-s');
+my @changes = (
+ 'A module.spin',
+ 'A readme.spin',
+ 'A script.spin',
+ 'D module.rpod',
+ 'D readme.rpod',
+ 'D script.rpod',
);
+is_deeply(\@status, \@changes, 'Git operations');
# Report the end of testing.
done_testing($count + 2);