A collection of test cases that would be great to see automated with LDTP or dogtail
Feel free to add below any test case your sick mind can come up with
- create a file, set its contents to "foo", open it in gedit, set the contents to "bar", save it, check the contents is "bar", check if the backup file is created and if it properly contains "foo"
- like 1, but using each one of the available encodings (the contents has to contain unicode characters instead of "bar")
- like 1, but before opening chmod the file (in a way that it is still writable), upon saving check perms are preserved
- like 1, but before opening chown the file (in a way that it is still writable), upon saving check ownnership is preserved
- like 1, but with a writable file inside a non writeable directory
- like 1, but with the file being a symlink
- like 1, but with the file being a hardlink
- like 3, 4 and 5, but with the file being a symlink
repeat all of the above with "keep backup file" disabled, check the backup is properly deleted repeat all the above for sftp, ftp, etc uris
(Note: current version of gedit doesn't yet pass some of the above, like 3 and 4 and all the remote vfs writing)
A script implementing tests 1 and 3 can be found at http://cvs.gnome.org/viewcvs/dogtail-tests/gedit/gedit-saving-tests.py?view=markup This should be expandable to cover all of the above tests, if someone wants to volunteer
Make a series of small testcases of editing operations (Undo, Cut&paste, changing preferences, etc) and run each test under valgring. For added coolness, parse the logs and warn when the total of lost bytes increases across different runs of each test.