formatting
improve tests
the common prefix for one file is the file's dirname (#553)