Files
RedBear-OS/tests/unistd/getpass.exp
T
Agoston Szepessy a83d4cbced Implement getpass()
Also make fields in `termios` public; required for modifying them.

There's an new type of test: `EXPECT_INPUT_BINS`. These require a `.exp`
file to be present along with the `.c` file. The `.exp` file takes the
produced binary as an argument and sends input to the program. This is
useful for testing functions like `getpass()`.
2024-07-23 16:07:25 +02:00

18 lines
382 B
Plaintext

#!/usr/bin/expect
set testgetpass [lindex $argv 0];
spawn $testgetpass
expect "Enter password: "
send -- "pass\r"
expect "Enter password: "
send -- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r"
expect "Enter password: "
send -- "\r"
expect {
"incorrect password" { exit 123 }
eof
}