Skip to content

Commit

Permalink
Delete files created during tests
Browse files Browse the repository at this point in the history
Also remove the check for `tests/data/README.md` which doesn't exist.
  • Loading branch information
samwilson authored Sep 11, 2024
1 parent 931312f commit d806f7c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/integration/CompileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ public function testDataFiles(): void
$converter = new MarkdownConverter($environment);
$markdownFiles = \glob(\dirname(__DIR__) . '/data/*.md');
foreach ($markdownFiles as $markdownFile) {
if (\basename($markdownFile) === 'README.md') {
continue;
}

$workingDir = \dirname($markdownFile);
// Create a temp tex file in the tests directory, so it's got access to images etc.
$tmpTexFile = $workingDir . '/CompileTest_' . \pathinfo($markdownFile, PATHINFO_FILENAME) . '.tex';
$prefix = $workingDir . '/CompileTest_';
$tmpTexFile = $prefix . \pathinfo($markdownFile, PATHINFO_FILENAME) . '.tex';
$markdown = \file_get_contents($markdownFile);
$latex = "\\documentclass{article}\n"
. "\\usepackage{listings, graphicx, hyperref, footmisc}\n"
Expand All @@ -43,6 +40,8 @@ public function testDataFiles(): void
$process->mustRun();
$this->assertStringContainsString('Output written', $process->getOutput());
$this->assertStringContainsString('1 page', $process->getOutput());
// Delete temp files.
\array_map('unlink', \glob($prefix . '*'));
}
}
}

0 comments on commit d806f7c

Please sign in to comment.