Skip to content

Commit

Permalink
Tweak filter tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevina committed Aug 2, 2019
1 parent 735b579 commit 00f937e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/filter-test
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ while (<STDIN>) {
next;
}

open F, ">test-data.in";
open F, ">tmp/test-data.in";
print F $in;
open F, ">test-data.expect";
open F, ">tmp/test-data.expect";
print F $out;
eval {
sys "$ASPELL filter --mode=none $parms < test-data.in > test-data.out";
sys "diff -u -Z test-data.expect test-data.out";
sys "$ASPELL filter --mode=none $parms < tmp/test-data.in > tmp/test-data.out";
sys "diff -u -Z tmp/test-data.expect tmp/test-data.out";
};
if ($@) {
$failed++;
Expand Down
24 changes: 24 additions & 0 deletions test/misc/commonmark-proc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/perl

use strict;
use warnings;
use autodie;

binmode(STDOUT, ":utf8");

use JSON;

$/ = undef;
open F, "commonmark-examples.json";

my $data = decode_json(<F>);

my $i = 1;
foreach my $obj (@$data) {
open F, ">tmp/$i.md";
binmode(F, ":utf8");
print F $obj->{markdown};
print F "\n";
close F;
$i++;
}

0 comments on commit 00f937e

Please sign in to comment.