1
1
mirror of https://github.com/wader/fq.git synced 2024-11-30 09:58:13 +03:00
fq/pkg/cli/test.exp

45 lines
696 B
Plaintext
Raw Normal View History

2021-09-18 13:31:03 +03:00
#!/usr/bin/env expect
# TODO: move this script somewere else
# TODO: run without NO_DECODE_PROGRESS
2021-09-18 13:31:03 +03:00
log_user 1
set timeout 3
2021-09-18 13:31:03 +03:00
expect_after {
timeout {exit 1}
}
spawn sh -c "NO_DECODE_PROGRESS=1 fq -o color=false -i . pkg/interp/testdata/test.mp3 2>&1"
2021-09-18 13:31:03 +03:00
expect "mp3> "
send ".\n"
expect "footers"
expect "mp3> "
# test completion
2021-09-18 13:31:03 +03:00
send ".frames | mp3_fr\t"
expect "mp3_frame"
send "\n"
expect "side_info"
expect "mp3> "
2021-09-18 13:31:03 +03:00
# test interrupt multiple outputs
send "range(100000) | d\n"
expect "123"
# ctrl-c
send "\x03"
expect "mp3> "
# test interrupt big json output
send "\[range(100000)\] | d\n"
expect "123"
# ctrl-c
send "\x03"
expect "mp3> "
# test exit
2021-09-18 13:31:03 +03:00
# ctrl-d
send "\x04"
expect eof