cram icon indicating copy to clipboard operation
cram copied to clipboard

Read arguments from a script instead of stdin

Open krallin opened this issue 3 years ago • 0 comments

If a program under test reads stdin (e.g. by accident), then cram's current behavior can be a little confusing, since what will happen is that it'll omit running anything because the script has been read.

For example, if your test file is

  $ echo 123
  123
  $ cat > /dev/null
  $ echo 456
  456
  $ echo 789
  789

Then running it yields:

   $ echo 123
   123
   $ cat > /dev/null
   $ echo 456
-  456
-  $ echo 789
-  789

This patch updates cram to pass the script via file instead, which makes this mistake harder to make. I've also updated one of the tests that was implicitly relying on this (debug.t).

krallin avatar Jan 17 '22 13:01 krallin