diff options
Diffstat (limited to 'tests/xdg-mime/t.notexist_mime_uninstall')
-rwxr-xr-x | tests/xdg-mime/t.notexist_mime_uninstall | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/xdg-mime/t.notexist_mime_uninstall b/tests/xdg-mime/t.notexist_mime_uninstall new file mode 100755 index 0000000..344dba4 --- /dev/null +++ b/tests/xdg-mime/t.notexist_mime_uninstall @@ -0,0 +1,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 |