| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
## Include utility functions. |
| 4 |
. "$XDG_TEST_DIR/include/testassertions.sh" |
| 5 |
. "$XDG_TEST_DIR/include/testcontrol.sh" |
| 6 |
|
| 7 |
## Test function |
| 8 |
test_cc_args() { |
| 9 |
test_start "$FUNCNAME: verify cc/bcc/subject/body/attach arguments work" |
| 10 |
|
| 11 |
|
| 12 |
addr="[email protected]" |
| 13 |
ADDR_TO="to_$addr" |
| 14 |
ADDR_CC="cc_$addr" |
| 15 |
ADDR_BCC="bcc_$addr" |
| 16 |
SUBJ="I am a subject about $XDG_TEST_SHORTID" |
| 17 |
BODY="I am the body. $XDG_TEST_SHORTID is short for $XDG_TEST_ID" |
| 18 |
|
| 19 |
test_init |
| 20 |
|
| 21 |
require_notroot |
| 22 |
## Require a running X server |
| 23 |
assert_display |
| 24 |
|
| 25 |
test_procedure |
| 26 |
|
| 27 |
assert_exit 0 xdg-email --cc "$ADDR_CC" --bcc "$ADDR_BCC" \ |
| 28 |
--subject "$SUBJ" --body "$BODY" "$ADDR_TO" |
| 29 |
|
| 30 |
assert_nostdout |
| 31 |
assert_nostderr |
| 32 |
|
| 33 |
assert_interactive "Did a new email open to '$ADDR_TO'?" y |
| 34 |
assert_interactive "Is the cc: line '$ADDR_CC'?" y |
| 35 |
assert_interactive "Is the bcc: line '$ADDR_BCC'?" y |
| 36 |
assert_interactive "Is the subject: line '$SUBJ'?" y |
| 37 |
assert_interactive "Is the body '$BODY'?" y |
| 38 |
assert_interactive "Please close any email windows opened by the test." C |
| 39 |
|
| 40 |
test_result |
| 41 |
} |
| 42 |
|
| 43 |
run_test test_cc_args |