| Index: third_party/xdg-utils/tests/xdg-mime/t.15-user_mime_uninstall2in1
|
| ===================================================================
|
| --- third_party/xdg-utils/tests/xdg-mime/t.15-user_mime_uninstall2in1 (revision 0)
|
| +++ third_party/xdg-utils/tests/xdg-mime/t.15-user_mime_uninstall2in1 (revision 0)
|
| @@ -0,0 +1,66 @@
|
| +#!/bin/bash
|
| +
|
| +## Include utility functions.
|
| +. "$XDG_TEST_DIR/include/testassertions.sh"
|
| +. "$XDG_TEST_DIR/include/testcontrol.sh"
|
| +
|
| +## Test function
|
| +test_user_mime_uninstall2in1() {
|
| +
|
| +## Begin the test.
|
| +test_start "$FUNCNAME: uninstall user mime type"
|
| +test_purpose "Verify that mime types get removed from the user space correctly."
|
| +
|
| +# Dependencies section
|
| +test_init
|
| +
|
| +require_notroot
|
| +
|
| +use_file "$XDG_TEST_DIR/xdg-mime/data/test2mime.xml" INPUT_FILE
|
| +edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST1_MIME "x-xdg-01-$XDG_TEST_ID"
|
| +edit_file "$INPUT_FILE" "x-xdg-test2pattern" TEST2_MIME "x-xdg-02-$XDG_TEST_ID"
|
| +
|
| +assert_file "$INPUT_FILE"
|
| +echo "text/$TEST1_MIME" >out.expect1
|
| +echo "text/$TEST2_MIME" >out.expect2
|
| +
|
| +echo "Some text." >testfile.xdg1test
|
| +echo "Some text." >testfile.xdg2test
|
| +assert_file testfile.xdg1test
|
| +assert_file testfile.xdg2test
|
| +
|
| +
|
| +assert_exit 0 xdg-mime query filetype testfile.xdg1test
|
| +assert_stdout
|
| +mv out.stdout out.save1
|
| +
|
| +assert_exit 0 xdg-mime query filetype testfile.xdg2test
|
| +assert_stdout
|
| +mv out.stdout out.save2
|
| +
|
| +# Install & verify mime type is installed
|
| +assert_exit 0 xdg-mime install --mode user "$INPUT_FILE"
|
| +
|
| +assert_exit 0 xdg-mime query filetype testfile.xdg1test
|
| +assert_stdout out.expect1
|
| +
|
| +assert_exit 0 xdg-mime query filetype testfile.xdg2test
|
| +assert_stdout out.expect2
|
| +
|
| +# Test steps section
|
| +test_procedure
|
| +
|
| +assert_exit 0 xdg-mime uninstall --mode user "$INPUT_FILE"
|
| +assert_nostdout
|
| +assert_nostderr
|
| +
|
| +## Verify uninstall
|
| +assert_exit 0 xdg-mime query filetype testfile.xdg1test
|
| +assert_stdout out.save1
|
| +
|
| +assert_exit 0 xdg-mime query filetype testfile.xdg2test
|
| +assert_stdout out.save2
|
| +
|
| +test_result
|
| +}
|
| +run_test test_user_mime_uninstall2in1
|
|
|
| Property changes on: third_party/xdg-utils/tests/xdg-mime/t.15-user_mime_uninstall2in1
|
| ___________________________________________________________________
|
| Name: svn:executable
|
| + *
|
|
|
|
|