| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
. "$XDG_TEST_DIR/include/testassertions.sh" |
| 4 |
|
| 5 |
. "$XDG_TEST_DIR/include/testcontrol.sh" |
| 6 |
|
| 7 |
test_query_missing_file() { |
| 8 |
INPUT_FILE='non-existent-file.xml' |
| 9 |
|
| 10 |
test_start "$FUNCNAME: verify correct error for missing file: $INPUT_FILE" |
| 11 |
test_purpose "Verify that the correct error is generated when the mime file is missing. This is bug 7123 case 1" |
| 12 |
|
| 13 |
## Check dependencies |
| 14 |
test_init |
| 15 |
|
| 16 |
# query requires a desktop environment |
| 17 |
require_notroot |
| 18 |
assert_nofile "$INPUT_FILE" |
| 19 |
|
| 20 |
## Main test |
| 21 |
test_procedure |
| 22 |
|
| 23 |
assert_exit 2 xdg-mime query filetype "$INPUT_FILE" |
| 24 |
assert_stderr |
| 25 |
assert_nostdout |
| 26 |
|
| 27 |
test_result |
| 28 |
} |
| 29 |
|
| 30 |
run_test test_query_missing_file |