OLD | NEW |
(Empty) | |
| 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_plain_file_uninstall() { |
| 9 ## Begin the test. |
| 10 test_start "$FUNCNAME: verify $FILE is uninstalled correctly from the desktop" |
| 11 |
| 12 # Dependencies section |
| 13 test_init |
| 14 |
| 15 INSFILE="xdgtestdata-$XDG_TEST_SHORTID.txt" |
| 16 DESKTOP="$HOME/Desktop" |
| 17 |
| 18 set_no_display |
| 19 echo "Some more boring text" > "$INSFILE" |
| 20 assert_file "$INSFILE" |
| 21 |
| 22 # Verify the test icon is not installed already. |
| 23 assert_exit 0 xdg-desktop-icon install "$INSFILE" |
| 24 assert_file_in_path "$INSFILE" "$DESKTOP" |
| 25 assert_interactive_notroot "Is an icon named '$INSFILE' present on the desktop?"
y |
| 26 |
| 27 # Test steps section |
| 28 test_procedure |
| 29 |
| 30 assert_exit 0 xdg-desktop-icon uninstall "$INSFILE" |
| 31 assert_nostdout |
| 32 assert_nostderr |
| 33 |
| 34 assert_file_not_in_path "$INSFILE" "$DESKTOP" |
| 35 assert_interactive_notroot "Is an icon named '$INSFILE' still present on the des
ktop?" n |
| 36 |
| 37 test_result |
| 38 } |
| 39 |
| 40 run_test test_plain_file_uninstall |
OLD | NEW |