-
Notifications
You must be signed in to change notification settings - Fork 137
Add assert_threads_result
helper and threads test
#607
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
abfc353
to
63e483f
Compare
Could you update CONTRIBUTING.md? |
Sure. But speaking of documentation, do you think we can do that in Ruby comments? Like test-unit does. And in the contribution guideline we just link to the file. I think it fits the convention better and it's easier for writers of methods (like me) to remember too 😛 |
We can write how to use API in the comments and CONTRIBUTING.md. I think that writing the explanation in CONTRIBUTING.md is good because they are well organized. |
I don't think having documentation in 2 places is a good idea. It's the same reason we only write command intro in |
6a0cc9c
to
f66966f
Compare
Well, I see. Or, we can create rdoc page from the comment? |
Yes. In that case, we'll need to write the comments follow yard's specification. |
c54ba10
to
9b7333d
Compare
@ono-max I've updated the contribution guideline for now. can you check it? thx |
Nice work! LGTM |
715079b
to
6430f40
Compare
You missed https://github.com/ruby/debug/pull/607/files#r843338555. Could you update it? |
|
||
expected_names.each do |expected| | ||
thread_names.reject! do |name| | ||
name.match?(expected) |
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.
We can use assert_match
method in this case, could you tell me the reason why you implemented so?
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.
Why do you think we can use it here? Remember, the order of threads info is not guaranteed. So we don't know which one will match.
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.
Ah, that's right. My bad 🙏
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.
No worries 😉
Do other changes look good to you?
6430f40
to
8b9a85e
Compare
end | ||
|
||
failure_msg = FailureMessage.new{create_protocol_message "result:\n#{JSON.pretty_generate res}.\nExpect all thread names to be matched. Unmatched threads:"} | ||
assert_equal [], thread_names, failure_msg |
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.
Can we use assert_empty
?
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.
Some notes:
0
and increment by1
, as shown in the below example. So asserting ids is pointless imo.