Menu

What I found when I pointed a CLI recorder at a second Rust rewrite
📰

What I found when I pointed a CLI recorder at a second Rust rewrite

DEV Community: rust·Emir Mrkaljević·6 days ago
#a5siqqcm
#devtorust#devto#dev#comment#uutils
Reading 0:00
15s threshold

I have been using behave to record how GNU coreutils 9.12 behaves, then replay the same cases against uutils , the Rust rewrite. That work has already led to a run of upstream bug reports and merged fix PRs. This week I pointed the same recorder at a second Rust rewrite: uutils findutils , starting with xargs , and compared it to GNU findutils 4.10.

The idea is the same. Record stdout, stderr, and the exit status from the reference tool, then replay the cases against the rewrite. A failure is a concrete difference, not a guess about what the tool "should" do.

The new suite lives at examples/xargs . It has 44 cases, recorded from GNU findutils 4.10.0, and they run in behave's CI. Three of those differences were real bugs. Each one is now an issue plus a fix PR with a test.

1. -I with the default command printed the input items

When -I , -i , or --replace is used without an explicit command, xargs should run echo once per input item.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.