Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed the File::Slurp dependency because it was seldom used and the…

… current version (9999.13) fails on Strawberry 5.10.1
  • Loading branch information...
commit 33e09e3fc74df52786eb286f28f3d5a1e2e0a3ea 1 parent 29ffc3c
@dandv dandv authored
View
2  Changes
@@ -1,5 +1,7 @@
This file documents the revision history for Perl extension Text::Markdown.
+ - Removed File::Slurp dependency (v. 9999.13 fails tests on Strawberry 5.10.1) (dandv)
+
1.0.29 2009-10-28T15:19:26
- Note Test::Differences is needed for tests to run (RT#50918)
- Change build_requires to test_requires in Makefile.PL where
View
1  Makefile.PL
@@ -18,7 +18,6 @@ requires 'Encode' => undef;
test_requires 'Test::More' => '0.42';
test_requires 'Test::Exception' => undef;
test_requires 'List::MoreUtils' => undef;
-test_requires 'File::Slurp' => '9999.08';
test_requires 'Test::Differences' => undef;
test_requires 'FindBin' => undef;
View
20 t/21fulldocs-text-markdown.t
@@ -4,7 +4,6 @@ use Test::More;
use FindBin qw($Bin);
use List::MoreUtils qw(uniq);
-use File::Slurp qw(slurp);
use Encode;
our $TIDY = 0;
@@ -47,16 +46,16 @@ sub tidy {
### being run when this file is required by other tests
unless (caller) {
- my $docsdir = "$Bin/Text-Markdown.mdtest";
- my @files = get_files($docsdir);
+ my $docsdir = "$Bin/Text-Markdown.mdtest";
+ my @files = get_files($docsdir);
- plan tests => scalar(@files) + 1;
+ plan tests => scalar(@files) + 1;
- use_ok('Text::Markdown');
+ use_ok('Text::Markdown');
- my $m = Text::Markdown->new();
+ my $m = Text::Markdown->new();
- run_tests($m, $docsdir, @files);
+ run_tests($m, $docsdir, @files);
}
sub get_files {
@@ -68,6 +67,13 @@ sub get_files {
return @files;
}
+sub slurp {
+ my ($filename) = @_;
+ open my $file, '<', $filename or die "Couldn't open $filename: $!";
+ local $/ = undef;
+ return <$file>;
+}
+
sub run_tests {
my ($m, $docsdir, @files) = @_;
foreach my $test (@files) {
View
7 t/34commandlinemarkdown.t
@@ -1,12 +1,13 @@
use strict;
use warnings;
use FindBin qw($Bin);
-use File::Slurp qw(slurp);
use Test::More tests => 2;
use Test::Exception;
-unshift(@ARGV, "$Bin/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax.text");
-my $expected = slurp("$Bin/Markdown-from-MDTest1.1.mdtest//Markdown_Documentation_-_Syntax.xhtml");
+my $filename = "$Bin/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax";
+unshift(@ARGV, "$filename.text");
+open my $file, '<', "$filename.xhtml" or die "Couldn't open $filename: $!";
+my $expected = do { local $/; <$file> };
lives_ok {
require "$Bin/../script/Markdown.pl";
Please sign in to comment.
Something went wrong with that request. Please try again.