Thread:Manual talk:JavaScript unit testing/Naming of test suite files/reply

Almost everything in tests/phpunit/includes is named with a 'Test.php' suffix; just yesterday I spent plenty of time fiddling with Block.php (Block class) and BlockTest.php (Block's test class), which was very pleasant to work with. It seems that most of the unit test files are similarly named: 'GlobalTest', 'ExternalStoreTest', 'HttpTest', 'MessageTest', 'MWNamespaceTest', 'SanitizerTest', 'RevisionTest', 'TitleTest', 'UploadTest', 'SearchDbTest', 'SearchEngineTest', 'SearchUpdateTest', 'DatabaseSqliteTest', 'DatabaseTest', 'ApiBlockTest', 'ApiWatchTest', 'ApiUploadTest', etc.

I would have been surprised and annoyed if the test class had been in another Block.php, and it would have made my life harder switching between a "Block.php" tab and another "Block.php" tab in my editor, trying to keep them straight. Yes the paths are different -- paths that are rarely shown in key parts of a programming editor's UI... When I encounter files that are confusingly named, I immediately want to change them to match our regular convention: with 'test' in the name.

Directory comparison, if that's something that's going to be done frequently, should probably be scripted up so people don't have to manually construct a command line every time -- even the simple case of matching names is not necessarily trivial.