Skip to content

Commit

Permalink
Add more tests based on suggestions during code review
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed Apr 8, 2024
1 parent 0b5b629 commit 90348ee
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ enum MissingClosingComment {
enum HasClosingComment {
}//end enum

function misplacedClosingCommentIndentation() {
} //end misplacedClosingCommentIndentation()
function misplacedClosingCommentWhitespace() {
} //end misplacedClosingCommentWhitespace()

function misplacedClosingCommentMultipleNewlines() {
}
Expand All @@ -97,6 +97,20 @@ function misplacedClosingCommentMultipleNewlines() {
function missingClosingComment() {
}

function commentHasMoreIndentationThanFunction() {
}
//end commentHasMoreIndentationThanFunction()

class Foo {
function commentHasLessIndentationThanFunction() {
}
//end commentHasLessIndentationThanFunction()

function misplacedClosingCommentWithIndentation() {
}
//end misplacedClosingCommentWithIndentation()
}//end class

// Anonymous classes don't need end comments.
$anon = new class {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,26 @@ enum MissingClosingComment {
enum HasClosingComment {
}//end enum

function misplacedClosingCommentIndentation() {
}//end misplacedClosingCommentIndentation()
function misplacedClosingCommentWhitespace() {
}//end misplacedClosingCommentWhitespace()

function misplacedClosingCommentMultipleNewlines() {
}//end misplacedClosingCommentMultipleNewlines()

function missingClosingComment() {
}//end missingClosingComment()

function commentHasMoreIndentationThanFunction() {
}//end commentHasMoreIndentationThanFunction()

class Foo {
function commentHasLessIndentationThanFunction() {
}//end commentHasLessIndentationThanFunction()

function misplacedClosingCommentWithIndentation() {
}//end misplacedClosingCommentWithIndentation()
}//end class

// Anonymous classes don't need end comments.
$anon = new class {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@ public function getErrorList($testFile='')
switch ($testFile) {
case 'ClosingDeclarationCommentUnitTest.1.inc':
return [
13 => 1,
17 => 1,
31 => 1,
41 => 1,
59 => 1,
63 => 1,
67 => 1,
79 => 1,
83 => 1,
89 => 1,
92 => 1,
98 => 1,
13 => 1,
17 => 1,
31 => 1,
41 => 1,
59 => 1,
63 => 1,
67 => 1,
79 => 1,
83 => 1,
89 => 1,
92 => 1,
98 => 1,
101 => 1,
106 => 1,
110 => 1,
];

case 'ClosingDeclarationCommentUnitTest.4.inc':
Expand Down

0 comments on commit 90348ee

Please sign in to comment.