Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Add simple shell variable expansion to the test case output #25

Open
jan-matejka opened this issue May 12, 2017 · 1 comment
Open

Add simple shell variable expansion to the test case output #25

jan-matejka opened this issue May 12, 2017 · 1 comment

Comments

@jan-matejka
Copy link

hi, I have not given this much thought yet but it would probably be nice to have a simple shell expansion in the test case.

For example when tesing a command based on git I have a test case like

  $ . ${TESTDIR}/setup
  $ my-cmd
  Initialized empty Git repository in /tmp/cramtests*/git-wc/.git/ (glob)

while with the available expansion I could have

  $ . ${TESTDIR}/setup
  $ my-cmd
  Initialized empty Git repository in ${GIT_WORK_TREE}/.git/

or possibly

  $ . ${TESTDIR}/setup
  $ my-cmd
  Initialized empty Git repository in ${GIT_WORK_TREE}/.git/ (expand)

note, in this case GIT_WORK_TREE is exported by the ${TESTDIR}/setup command as an input variable for my-cmd

In general I expect this to be helpfull wherever the command output is based on an env variable and supporting only the most basic expansion like ${VAR}, no ${VAR:-foo} etc would go a long way.

@roman-neuhauser
Copy link

how should Cram deal with multiline values?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants