Look at h2xs, and the files it creates. It creates a test.pl, which you can look at. Or, look at the hundreds of other modules to see what people do. Generally, there is either a test.pl, or a */t directory with test files (which have a .t extension).