Repository navigation
numfmt: restore the number_str the build needs, and sort: capture -z output as bytes - #229
Merged
Merged
Conversation
…output as bytes Two regressions on main, both found by running the suite. numfmt did not compile: number_str is called at numfmt.v:74 and :169 but not defined anywhere. The vlang#224 merge removed the definition at :99, and the other copy that was in the file came from a branch that is not on main, so main was left with no definition at all. Restored the one with the GNU parity comment, which is the one that was there before. sort's -z test failed for a different reason than it looked. sort -z is correct: on b\0c\nd\0e\n it writes b\0c\nd\0e\n\0, nine bytes, matching GNU. The test read the output through os.execute, which hands the captured bytes over as a string, and the NUL bytes do not survive that: os.execute reported six bytes with the NULs gone. The test now captures to a file and reads it back with os.read_bytes, so the comparison is on the real bytes. Suite after: 41 passed, 3 failed, 8 skipped of 52. The three that fail all read standard input, which the Windows build of this V does not put in binary mode, and that is a change in the V compiler rather than in this repository.
GNU writes --input-range=LO-HI, and the descriptions in vlang#193 differ from that. The flag module puts a space between the option name and its argument description, so this gets --input-range =LO-HI rather than --input-range=LO-HI. The equals sign is the part that carries the meaning, and the space is a limitation of the flag module rather than something this repository can change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two regressions on main, both found by running the suite after the last batch of merges.
numfmt does not compile
number_stris called atnumfmt.v:74and:169but is not defined anywhere inthe file:
The #224 merge removed the definition at
:99. The other copy that was in the filecame from a branch that is not on main, so main was left with no definition at all.
This restores the one with the GNU parity comment, which is the one that was there
before #224.
sort's -z test failed for a different reason than it looked
sort -zis correct. Onb\0c\nd\0e\nit writesb\0c\nd\0e\n\0, nine bytes,matching GNU 9.4:
The test read the output through
os.execute, which hands the captured bytes over asa string, and the NUL bytes do not survive that:
os.executereported six byteswith the NULs gone, which is why the assertion saw
bcwhereb\0cwas expected.The test now captures to a file and reads it back with
os.read_bytes, so thecomparison is on the real bytes.
Suite
The three that fail —
cksum,shuf,sort— all read standard input, which theWindows build of this V does not put in binary mode. That is
set_stream_binary_modeinvlib/builtin/builtin_windows.c.v, a change in the Vcompiler rather than in this repository, so it is not fixed here.