Hacker News new | ask | show | jobs
by rverghes 4198 days ago
You'd probably see something similar when looking at a C/C++ project. I would expect significant coupling between header and source files.

The solution there was for future languages to combine the two. Maybe we'll see a future language combine unit tests and source into the same file.

Heh, maybe such a language would refuse to compile if public functions did not have an associated test.

2 comments

No need to wait. Rust has basic unit tests inside the source files doc.rust-lang.org/0.12.0/guide-testing.html
> refuse to compile if public functions did not have an associated test

Sounds like my worst nightmare.