-
Notifications
You must be signed in to change notification settings - Fork 1.1k
tests: Read tool args in test files #14144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Forgot to say thanks for picking up this handy idiom. In return, I'm going to work on my ticket about test ignoring my options. |
a6a0804
to
d6b01fe
Compare
d6b01fe
to
eb4b8cb
Compare
eb4b8cb
to
643314d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGRM
@@ -58,7 +59,8 @@ def toolArgsParse(lines: List[String]): List[String] = { | |||
val endc = "*" + "/" // be forgiving of /* scalac: ... */ | |||
def stripped(s: String) = s.substring(s.indexOf(tag) + tag.length).stripSuffix(endc) | |||
val args = lines.to(LazyList).take(10).filter { s => | |||
s.contains("// " + tag) | |||
s.contains("//" + tag) | |||
|| s.contains("// " + tag) | |||
|| s.contains("/* " + tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these also be accepted?
"// " + tag
with 2 or more spaces or a tab"/*" + tag
with no spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should consider a regex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less (ways) is more, IMO. I wouldn't have even added "/* ", but someone did back in scala/scala so I kept it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're called s'mores for a reason. I see partest doesn't look at opening comment. Could filter on tag and then on open comment preceding it. As sample UX, I learned yesterday that commenting out an // error
line does not suppress the error expectation. So temporarily commenting out requires two edits. My takeaway is that a test can be forgiving, but should help disallow "my check file was not used" or "my options were not used" and I didn't know it and the test has been broken all along.
No description provided.