Hacker News new | ask | show | jobs
by sambal 2539 days ago
Python and Rust go the “documentation test” route as well.

Go goes the opposite direction with “testable examples” that are written alongside test code and added to generated documentation.

https://docs.python.org/2/library/doctest.html

https://doc.rust-lang.org/rustdoc/documentation-tests.html

https://golang.org/pkg/testing/#hdr-Examples