Debian Codegraph @

tests/xdg-email/t.32-email_missing_attach

raw
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_email_missing_attach() {
9 test_start "$FUNCNAME: verify an error when --attach does not have a valid file"
10
11 ADDR="[email protected]"
12
13 test_init
14
15 require_notroot
16 ## Require a running X server
17 assert_display
18
19 get_unique_name TARG 'attach.txt'
20 assert_nofile "$TARG"
21
22 test_procedure
23
24 assert_exit 2 xdg-email --attach "$TARG" "$ADDR"
25 assert_nostdout
26 assert_stderr
27
28 assert_interactive "Did an email open to '$ADDR'?" n
29 assert_interactive "Please close any email windows opened by the test." C
30
31 test_result
32 }
33
34 run_test test_email_missing_attach