| 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_open_basic() { |
| 9 |
test_start "$FUNCNAME: verify basic file open test." |
| 10 |
|
| 11 |
test_init |
| 12 |
|
| 13 |
require_notroot |
| 14 |
|
| 15 |
## Require a running X server |
| 16 |
assert_display |
| 17 |
|
| 18 |
get_unique_name TARG 'open.txt' |
| 19 |
echo "I am open." > $TARG |
| 20 |
assert_file "$TARG" |
| 21 |
|
| 22 |
|
| 23 |
test_procedure |
| 24 |
|
| 25 |
assert_exit 0 xdg-open $TARG |
| 26 |
assert_nostdout |
| 27 |
assert_nostderr |
| 28 |
|
| 29 |
assert_interactive "Did a text editor open a file containing the string 'I am open.'?" y |
| 30 |
assert_interactive "Please close any windows opened by this test." C |
| 31 |
|
| 32 |
test_result |
| 33 |
} |
| 34 |
|
| 35 |
run_test test_open_basic |