An .io file can be used for testing a program using the Terminal.
Here is the syntax for such a file:
- At the start of the file you can write any comment that you want, as long as a line doesn't start with '> '
- If you want to specify command line arguments you can do this here by beginning a line with '! '. Your command line args should be seperated by spaces.
- After that you can specify your first input line. It has to start with '> '
- The following line(s) specify the output for this input
- To specify a next input simply add a new line starting with '> '
- A file has to end with an output line!
- The quit command is automatically added to the end!
An example would be
This text is ignored like the Praktomat ignores your cries for mercy ! fancy music > msg Never gonna give you up Never gonna let you down Never gonna run around and desert you Never gonna make you cry Never gonna say goodbye Never gonna tell a lie and hurt you > meaning of life 42
By default it is tested that the here provided output and the actual output are the same.
You can also specify that the output for a command should start with the here specified output by putting a ... after it.
> pi 3.14159...
insures that the output for the command pi starts with 3.14159
> test-using-praktomat Error, ...
insures that the command test-using-praktomat should result in an Error.