summaryrefslogtreecommitdiff
path: root/tests/xdg-icon-resource/t.icon_svg_system_uninstall
blob: c0b9f6bf79b20faa670e1e0490dcf34efddfa9bc (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
43
#!/bin/bash

## Include utility functions.
. "$XDG_TEST_DIR/include/testassertions.sh"

. "$XDG_TEST_DIR/include/testcontrol.sh"

## Test function
test_icon_svg_system_uninstall() {
ICON="red-SVG.svg"

test_start "$FUNCNAME: verify $ICON is uninstalled correctly with --mode system"

## Begin the test.
icondir="$XDG_TEST_DIR/icons"
systempath="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps"

# Dependencies section
test_init

require_root

set_no_display
use_file "$XDG_TEST_DIR/icons/$ICON" ICONFILE
assert_file "$ICONFILE"

# Verify the test icon is not installed already.
assert_exit 0 xdg-icon-resource install --mode system "$ICONFILE"
assert_file_in_path "$ICONFILE" "$systempath"

# Test steps section
test_procedure

assert_exit 0 xdg-icon-resource uninstall --mode system "$ICONFILE"
assert_nostdout
assert_nostderr

assert_file_not_in_path "$ICONFILE" "$systempath"

test_result
} 

run_test test_icon_svg_system_uninstall