4 ms·
I'm not sure I like having tests in the same file with the code. In real code bases it's very common to just read the code, and cluttering that with huge swaths
by eliben 13y ago
I'm not sure I like having tests in the same file with the code. In real code bases it's very common to just read the code, and cluttering that with huge swaths of unit-tests is counter-productive.
That said, Pyret appears to be aimed at education so this may make more sense.
- skrishnamurthi 13y agoThen you can put your tests in a `check` block and move them elsewhere. You don't have to use `where` except when it makes sense.
- reeses 13y agoThis is bouncing against the perpetual "code as text" problem. Put the tests and docs in with the code and you end up going into "scanning" mode. The actionable information density per character is lower. Put the tests and docs outside the code and you (or that obnoxious guy who just changed > to >=) don't update the tests or the docs. In the worst case (cough functional web tests) people tend to disable the tests because it's too much work to get them to conform to the changes and everyone is on fire and babies are dying and this needs to be done in production now.