Skip to content

Commit

Permalink
Don't check multiline testing outputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
tetafro committed Sep 7, 2024
1 parent 54d779a commit 37dcdfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ func isSpecialBlock(comment string) bool {
strings.Contains(comment, "#define")) {
return true
}
if strings.HasPrefix(comment, "// Output: ") {
if strings.HasPrefix(comment, "// Output:") ||
strings.HasPrefix(comment, "// Unordered output:") {

This comment has been minimized.

Copy link
@mitar

mitar Sep 7, 2024

Can we also add // Example output: which is something I use sometimes when examples do not have deterministic outputs (then they cannot be run, but the still serve as documentation).

return true
}
return false
Expand Down
7 changes: 6 additions & 1 deletion checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,15 @@ func TestIsSpecialBlock(t *testing.T) {
isSpecial: true,
},
{
name: "Test output",
name: "Test testing output",
comment: "// Output: true",
isSpecial: true,
},
{
name: "Test multiline testing output",
comment: "// Output:\n// true\n// false",
isSpecial: true,
},
}

for _, tt := range testCases {
Expand Down

0 comments on commit 37dcdfb

Please sign in to comment.