test: extract the method to create an index file