mgalloy / idldoc

Documenting IDL code
Other
21 stars 13 forks source link

Support for doctests #29

Open mgalloy opened 12 years ago

mgalloy commented 12 years ago

Doctests are simple tests embedded in the documentation.

Inside a "tests" tag, any line that starts with "IDL> " would be executed and the output compared to the following line(s) that don't start with "IDL> ".

For example:

;+
; Factorial function.
; 
; :Tests:
;    IDL> a = factorial(5)
;    IDL> print, a
;        120
;-

The commands in a single :Tests: tag should run in a single scope (so the a variable above is seen by the second command).