Skip to content

Commit

Permalink
Added a test file and testcase for issue #831.
Browse files Browse the repository at this point in the history
  • Loading branch information
thirsch authored and sebastianbergmann committed Nov 28, 2020
1 parent 0a7f0ac commit 61b8db0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/_files/source_without_newline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php // This file contains no newline.
10 changes: 10 additions & 0 deletions tests/tests/StaticAnalysis/CoveredFileAnalyserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,14 @@ public function testGetLinesToBeIgnoredWhenIgnoreIsDisabled(): void
)
);
}

public function testGetLinesOfCodeForFileWithoutNewline(): void
{
$this->assertEquals(
1,
(new ParsingCoveredFileAnalyser(false, false))->linesOfCodeFor(
TEST_FILES_PATH . 'source_without_newline.php'
)->linesOfCode()
);
}
}

0 comments on commit 61b8db0

Please sign in to comment.