summaryrefslogtreecommitdiff
path: root/t/spin/errors.t
diff options
context:
space:
mode:
authorRuss Allbery <rra@cpan.org>2021-09-09 16:17:46 -0700
committerRuss Allbery <rra@cpan.org>2021-09-09 16:17:46 -0700
commitf43e7f41e58cb096d0f275fb8ae6940d359d699e (patch)
tree26e36d054222217d118fb2c4c1dbd09be00146ad /t/spin/errors.t
parent99933cd7ba67347a5043ffdfc4b369d35f6a06f8 (diff)
Read entire thread files when parsing
Rather than trying to carefully read thread files paragraph by paragraph, read the entire file at once and reuse _split_paragraphs to separate it into parseable chunks. Add line number tracking to the input file stack and use that to improve error reporting.
Diffstat (limited to 't/spin/errors.t')
-rwxr-xr-xt/spin/errors.t22
1 files changed, 12 insertions, 10 deletions
diff --git a/t/spin/errors.t b/t/spin/errors.t
index 6c27a87..a9069ae 100755
--- a/t/spin/errors.t
+++ b/t/spin/errors.t
@@ -16,18 +16,20 @@ use File::Temp;
use Test::More tests => 2;
-# Expected errors from spinning the error file.
+# Expected errors from spinning the error file. The line numbers are still
+# not entirely correct because line tracking is very complicated and still not
+# entirely correct.
my $EXPECTED_ERRORS = <<'ERRORS';
errors.th:1: cannot find argument 2: Did not find opening bracket after prefix: "\s*", detected at offset 2
-errors.th:2: invalid macro placeholder \2 (greater than 1)
-errors.th:2: invalid macro argument count for \badcount
-errors.th:4: unknown variable \=UNKNOWN
-errors.th:4: unknown command or macro \unknown
-errors.th:5: space in anchor "#foo bar"
-errors.th:5: no package release information available
-errors.th:5: no sitemap file found
-errors.th:5: no package version information available
-errors.th:5: cannot stat file nonexistent-file
+errors.th:3: invalid macro placeholder \2 (greater than 1)
+errors.th:5: invalid macro argument count for \badcount
+errors.th:9: unknown variable \=UNKNOWN
+errors.th:11: unknown command or macro \unknown
+errors.th:14: space in anchor "#foo bar"
+errors.th:15: no package release information available
+errors.th:16: no sitemap file found
+errors.th:17: no package version information available
+errors.th:17: cannot stat file nonexistent-file
ERRORS
require_ok('App::DocKnot::Spin::Thread');