Skip to content

Latest commit

 

History

History
91 lines (62 loc) · 1.64 KB

io.md

File metadata and controls

91 lines (62 loc) · 1.64 KB

I/O Validation

Using This Guide

This is an example markdown file with an annotated test command.

To see a summary of what commands will be run:

mm.py -d io.md

To run this file and validate the expected output:

mm.py io.md

Be sure to checkout the raw version of this file to see the annotations.

Checking stdout/stderr

This is an annotated command. When the mm.py utility is run, the following code block will be executed:

echo "test"

You can run multiple commands within the same block, and validate stderr as well.

Note: The expected_stdout_lines and expected_stderr_lines directives ignore output that doesn't match an expected line. Validation will fail only if expected lines do not appear in stdout/stderr. You can have extra output and still pass validation.

echo "test"
echo "another_output_line"
echo "test2"

echo "error" 1>&2

Checking return code

By default, all code blocks are expected to return 0. You can change this behavior with the directive expected_return_code:

exit 1

A missing or null value for expected_return_code will ignore all return codes.

exit 15

Navigation