Completed test for counting words of each length in a file