I think the key is figuring out the criteria by which you can test a file is fixed width and that depends on your requirements. If the criteria is too broad then the validity of the test will decrease to the point where the test is useless.
A different approach would be to look for a certain pattern in the record identifier and record length, again depending on your requirements for example:
First record starts with H and second with D third with T. The pattern repeats and all H records, D records and T records are the same length.
Good Luck