Skip to content

cmds/core/cmp: major cleanup; cmds/core/comm: minor cleanup, tinygo test works for both now#2612

Merged
rminnich merged 4 commits into
u-root:mainfrom
rminnich:tinygotests
Feb 7, 2023
Merged

cmds/core/cmp: major cleanup; cmds/core/comm: minor cleanup, tinygo test works for both now#2612
rminnich merged 4 commits into
u-root:mainfrom
rminnich:tinygotests

Conversation

@rminnich
Copy link
Copy Markdown
Member

@rminnich rminnich commented Feb 6, 2023

cmp did not match the standard cmp in some important ways, revealed by tinygo testing.

So:
fix error handling to return wrapped errors and defined types
fix stderr to print real errors
fix stdout to print file differences, if any
print nothing if files are identical
remove the chans, which did not properly communicate EOF anyway

cmp now correctly passes
tinygo test

Signed-off-by: Ronald G. Minnich rminnich@gmail.com

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2023

Codecov Report

Base: 74.88% // Head: 74.85% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (ce752eb) compared to base (bf5a9ac).
Patch coverage: 91.66% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2612      +/-   ##
==========================================
- Coverage   74.88%   74.85%   -0.03%     
==========================================
  Files         408      408              
  Lines       41380    41380              
==========================================
- Hits        30986    30974      -12     
- Misses      10394    10406      +12     
Impacted Files Coverage Δ
cmds/core/cmp/cmp.go 90.78% <91.17%> (ø)
cmds/core/comm/comm.go 90.14% <100.00%> (ø)
pkg/acpi/bios.go 0.00% <0.00%> (-27.03%) ⬇️
pkg/acpi/rsdp_unix.go 82.60% <0.00%> (-4.35%) ⬇️
cmds/core/mv/mv.go 77.27% <0.00%> (-2.28%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rminnich rminnich changed the title cmds/core/cmp: major cleanup cmds/core/cmp: major cleanup; cmds/core/comm: minor cleanup, tinygo test works for both now Feb 6, 2023
cmp did not match the standard cmp in some important ways,
revealed by tinygo testing.

So:
fix error handling to return wrapped errors and defined types
fix stderr to print real errors
fix stdout to print file differences, if any
print nothing if files are identical
remove the chans, which did not properly communicate EOF anyway

cmp now correctly passes
tinygo test

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
comm now uses the errors packages, and works now for tinygo

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
@rminnich rminnich merged commit 17f9228 into u-root:main Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants