Skip to content

Commit

Permalink
Add note about square brackets to tests README
Browse files Browse the repository at this point in the history
This is part of M4, not specific to our test-suite, but it's a question
that comes up often, and everyone (myself included) tends to forget how
it's done.
  • Loading branch information
dmnks committed Nov 12, 2024
1 parent 6e19c16 commit ba96f1a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,13 @@ as well as the existing tests. Below are the specifics of RPM's test-suite:
`runroot_user -n <name>` to run a binary as a specific user
* If no snapshot was used, just call the RPM binaries normally
* Store any working files in the current directory (it's always writable)

### Tips & Tricks

* Sometimes, you may need to specify a literal square bracket, such as in RPM
commands using `--qf` format strings. Do that by wrapping the whole script
(or expected output) in double square brackets, for example:

RPMTEST_CHECK([[
runroot rpm -q --qf '[%{FILENAMES}\n]' ...
]])

0 comments on commit ba96f1a

Please sign in to comment.