Skip to content

Commit

Permalink
tests: swap out the second spawn_tty test
Browse files Browse the repository at this point in the history
Different tty implementations will handle this differently; Linux, for
instance, doesn't follow the classical approach of interpreting ICANON at
time of read(2).  Instead, it interprets ICANON at time of ingestion into
the buffer.

I don't think I can reliably test any flag being twiddled off then on again,
so just test a cc change in addition to our -ICANON test.

Signed-off-by: Kyle Evans <[email protected]>
  • Loading branch information
kevans91 committed Jan 25, 2024
1 parent ca35f1f commit 1ed1391
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/spawn_stty.orch
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ stty("lflag", 0, tty.lflag.ICANON)
write "Hello the"
match "^Hello the$"

-- We should be able to toggle it off then back on again, so the next will
-- timeout.
-- Also test cc changes
spawn("cat")

stty("lflag", 0, tty.lflag.ICANON)
write "Hello the"
stty("lflag", tty.lflag.ICANON)
stty("cc", {
VEOF = "^F"
})
write "Hello the^F"

fail(function()
exit(0)
end)
match "^Hello the$"
exit(1)

0 comments on commit 1ed1391

Please sign in to comment.