I did try to implement this in d_do_test.exp, but have yet to figure out why this doesn't work correctly.

IIRC from last time looking at it, it seemed that when it spawns the program, it passes it as "foo bar doo" which is treated as one argument.