How to compile a test file

How do I compile a test file to test functionality of my script?

Please post the script and some examples of valid and invalid data.