blob: 344dba4a19940e26218459ac9a2646462b2643e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/bin/bash
## Include utility functions.
. "$TEST_CODE_DIR/include/testassertions.sh"
. "$TEST_CODE_DIR/include/testdep.sh"
. "$TEST_CODE_DIR/include/testcontrol.sh"
## Test function
test_notexist_mime_uninstall() {
INPUT_FILE="$TEST_CODE_DIR/xdg-mime/data/testmime.xml"
# TODO: should follow the filename tests.
QUERY_FILE="testfile.xdgtest"
## Begin the test.
test_start "$FUNCNAME: uninstall mime type that is not present"
# Dependencies section
test_init
set_no_display
assert_file $INPUT_FILE
echo "Some text." > $QUERY_FILE
assert_file "$QUERY_FILE"
# Install & verify mime type is installed
assert_exit 0 xdg-mime query filetype $QUERY_FILE
assert_stdout "$TEST_CODE_DIR/xdg-mime/data/textplain.expected"
# Test steps section
test_procedure
assert_exit 0 xdg-mime uninstall --user "$INPUT_FILE"
assert_nostdout
assert_nostderr
## Verify uninstall
assert_exit 0 xdg-mime query filetype $QUERY_FILE
assert_stdout "$TEST_CODE_DIR/xdg-mime/data/textplain.expected"
test_result
}
run_test test_notexist_mime_uninstall
|