Skip to content

Commit

Permalink
improve error message for missing shell expression
Browse files Browse the repository at this point in the history
Summary:
I had the following Markdown test:

```
# Make sure Scrut metadata is included.

## Test

\`\`\`scrut
DEBUG_PAR_MAIN="yes" $CLI 2>&1
[0]
\`\`\`
```

I forgot to prefix it with $. This adds a suggestion to the error so it's more obvious.

Reviewed By: abesto

Differential Revision: D61016388

fbshipit-source-id: da8d7fe9c4dae21d8636fd0e75c0dd4cdb9eb027
  • Loading branch information
AndreasBackx authored and facebook-github-bot committed Aug 9, 2024
1 parent cf252e3 commit a916016
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parsers/line_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl LineParser {
if !has_commands {
if has_expectations {
bail!(
"line {}: testcase output expectation(s) given, but no shell expression specified",
"line {}: testcase output expectation(s) given, but no shell expression specified. Did you forget to prefix the command with '$'?",
line_index + 1
)
}
Expand Down

0 comments on commit a916016

Please sign in to comment.