From Fedora Project Wiki
Description
This test case ensures that desktop-file-utils functions correctly. It tests validating a .desktop file using the desktop-file-validate
utility.
Setup
Install the desktop-file-utils
package:
sudo dnf install desktop-file-utils
- Create or have a
.desktop
file available for testing.Here's an example [gist]
How to test
- Validate the .desktop file
desktop-file-validate /path/to/yourfile.desktop
Expected Results
- The
desktop-file-validate
command should complete without errors. - If the .desktop file is valid, there should be no output.
- If the .desktop file is invalid, the command should output specific errors indicating what is wrong with the file.
Optional
For exploratory testing:
- Modify the .desktop file to introduce errors, such as missing required fields, and run the validation again to check that it catches the errors.
- Test with various .desktop files with different configurations to ensure the validator catches all issues.