Skip to content

Conversation

@ChrisDryden
Copy link
Contributor

@ChrisDryden ChrisDryden commented Nov 20, 2025

Creating this PR to showcase all of the open stty PR's to show that when combined that the STTY tests are able to run on the Github action runners and that two of the GNU stty tests now pass.

@ChrisDryden
Copy link
Contributor Author

I'm seeing

PASS: tests/stty/stty.sh
FAIL: tests/stty/stty-invalid.sh
PASS: tests/stty/stty-pairs.sh
FAIL: tests/stty/stty-row-col.sh

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/stty/bad-speed. tests/stty/bad-speed is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/stty/stty-invalid. tests/stty/stty-invalid is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/stty/stty-row-col. tests/stty/stty-row-col is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/stty/stty is now passing!
Congrats! The gnu test tests/stty/stty-pairs is now passing!

@ChrisDryden
Copy link
Contributor Author

Those two commits should cover the two tests:

tests/stty/stty-invalid.sh
tests/stty/stty-row-col.sh

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/stty/bad-speed. tests/stty/bad-speed is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@ChrisDryden
Copy link
Contributor Author

This last commit should cover the use case for the bad-speed test, would add an additional 5 passing GNU tests if this we can get a version of this into the code-base 🎉

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/stty/bad-speed is now passing!


/// GNU uses an unsigned 32-bit integer for row/col sizes, but then wraps around 16 bits
/// this function returns Some(n), where n is a u16 row/col size, or None if the string arg cannot be parsed as a u32
fn parse_rows_cols(arg: &str) -> Option<u16> {
Copy link

Choose a reason for hiding this comment

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

Isn't this parse logic for most integer input that is supported?

GNU does it at least for line too and for any other control char.

In general the parser seems to be worth being moved to an utility module that is share through the other tools given that in GNU the same logic (e.g. xnumtoumax) is at least used by:

  • nproc
  • fold
  • fmt
  • head
  • ls
  • cksum
  • split
  • stty

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