| 1 | import time |
| 2 | |
| 3 | fn test_unbuffer_stdout() { |
| 4 | // TODO: add a more extensive test, perhaps using expect, |
| 5 | // that does not require an active user to verify its validity. |
| 6 | // Currently this just tests that unbuffer_stdout/0 can be called, |
| 7 | // and its effects can be observed by commenting the call to it, |
| 8 | // on the next line, and then re-running the test: |
| 9 | unbuffer_stdout() |
| 10 | print('#---') |
| 11 | for i in 0 .. 21 { |
| 12 | print('\b\b\b> ${i:02}') |
| 13 | time.sleep(20 * time.millisecond) |
| 14 | } |
| 15 | println('\b\b\b done') |
| 16 | assert true |
| 17 | } |
| 18 | |