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
Use echo command in mswin platform #9670
Conversation
Why this test executes printf command? I think just comparing with fixed string is more reasonable and faster. |
test/ruby/test_compile_prism.rb
Outdated
if /mswin|ucrt/ =~ RUBY_PLATFORM | ||
assert_prism_eval('`echo #{"100"}`') | ||
else | ||
assert_prism_eval('`printf #{"100"}`') | ||
end |
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.
This assertion seems nothing different from the immediately above from the point of parser.
if /mswin|ucrt/ =~ RUBY_PLATFORM | |
assert_prism_eval('`echo #{"100"}`') | |
else | |
assert_prism_eval('`printf #{"100"}`') | |
end |
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.
Sorry, misread.
#{1}
and #{"100"}
.
I don't think there is a reason to use a different command.
if /mswin|ucrt/ =~ RUBY_PLATFORM | |
assert_prism_eval('`echo #{"100"}`') | |
else | |
assert_prism_eval('`printf #{"100"}`') | |
end | |
assert_prism_eval('`echo #{"100"}`') |
Oh I didn't realize this test had been written like this. I don't think we should do any kind of external command here, the point is parsing. We should define |
30d26c7
to
16a44a9
Compare
@kddnewton I'm going to merge this with simple replacement. |
Sounds good, thanks! I'll make another pass to define |
@kddnewton
test_InterpolatedXStringNode
is failed with mswin platform becauseprintf
is not provided on native windows console.I'm not sure why it doesn't use
echo
command same as first assertion.