Skip to content
Rusty Russell edited this page Sep 29, 2011 · 1 revision

ccanlint's examples_run test works when Example: sections contain a comment of form "// Given X outputs Y".

The value X is passed to your example program on the command line and also fed into stdin. The output Y must be a single line, and spaces must be correct. You can enclose either one in "" or ''.

You can have multiple such comments.

Usually the Example in _info is tested this way, which also spells out to the casual reader what your example does.

Clone this wiki locally