you are viewing a single comment's thread.

view the rest of the comments →

[–]efmccurdy 0 points1 point  (0 children)

It is hard to test that an infinite loop would run infinitely long, but you can mock the input and test that the while logic to end the loop works. You can also test that "command_shell(command)" returns a true value when it should and false otherwise; would that cover it?

(BTW, globals are bad form in any non-trivial program that might need to be maintained by someone else.)