Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Abstract/jdx-ruby-32.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ def test
assert_equal ruby.to_s, shell_output("#{ruby} -e 'puts RbConfig.ruby'").chomp
assert_equal "3632233996",
shell_output("#{ruby} -rzlib -e 'puts Zlib.crc32(\"test\")'").chomp
assert_equal " \t\n\"\\'`@$><=;|&{(",
# libedit has fewer word break characters than readline
assert_includes [" \t\n\"\\'`@$><=;|&{(", " \t\n`><=;|&{("],
shell_output("#{ruby} -rreadline -e 'puts Readline.basic_word_break_characters'").chomp
Comment on lines +257 to 258
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For improved readability and maintainability, consider extracting these long string literals into constants with descriptive names. This would make it clearer what each string represents (i.e., readline vs. libedit characters) and make the test easier to understand.

For example:

readline_chars = " \t\n\"\\'`@$><=;|&{("
libedit_chars = " \t\n`><=;|&{("
assert_includes [readline_chars, libedit_chars],
  shell_output("#{ruby} -rreadline -e 'puts Readline.basic_word_break_characters'").chomp

assert_equal '{"a"=>"b"}',
shell_output("#{ruby} -ryaml -e 'puts YAML.load(\"a: b\")'").chomp
Expand Down
Loading