Fix hashkey's inspect: "rocket" style to "colon" style #240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to improve the handling of symbols, hash key formatting, and test coverage, as well as minor adjustments to the Dockerfile and test file paths. The most significant updates include enhancements to how symbols and hash keys are represented in
inspect
methods compatible with mruby, particularly in how it formats symbol keys.ref mruby/mruby@baeeb5e
Enhancements to symbol and hash key handling:
src/c_hash.c
: Updatedc_hash_inspect
to format hash keys differently based on their type (symbol or other types). Symbols are now displayed in a more concise format.src/console.c
: Added a helper functionmrbc_p_sub_hashkey
to format hash keys consistently when printing hashes. Updatedmrbc_print_sub
to use this helper function [1] [2].src/symbol.c
: Modifiedc_symbol_inspect
to include quotes around symbols with colons, improving their readability.Updates to test cases:
test/array_test.rb
: Adjusted expected outputs intest_inspect
to reflect the updated formatting of hash keys and symbols.test/symbol_test.rb
: Added a new test case for theinspect
method to verify the formatting of symbols with colons.test/div_mod_test.rb
: Renamed the test class fromSymbolTest
toDivModTest
for clarity.Dockerfile improvements:
Dockerfile
: Changed thegit clone
command to use--depth 1
for a shallow clone, reducing download size. Updated defaultMRUBY_CONFIG
topicoruby-test
for consistency.Test file path adjustment:
test/0_runner.rb
: Fixed the file path topicotest
to ensure compatibility with the directory structure.