Create an empty scripted-diff commit (use the `--allow-empty` option)
with `echo scripted-diff;` as the shell script, then run:
arc scripted-diff
Should return:
Scripted-diff check is successful
Modify any file then run:
arc scripted-diff
Should return:
```
Scripted-diff check cannot run due to uncommited changes. Please commit
or reset your changes.
```
Reset the file change then amend the commit message to set the shell
script section to:
cat filenotfound.txt
Then run:
arc scripted-diff
Should return:
```
Scripted-diff: the script returned an error (1): cat: filenotfound.txt:
No such file or directory
```
Amend the commit message to set the shell script section to:
```
echo "/**/" | tee -a arcanist/workflow/ArcanistScriptedDiffWorkflow.php
```
Should return:
Scripted-diff: scripted output does not match the commit content.
Change the commit message to set the shell script section to:
```
echo "/* This comment is really too long, clang-format will cut it to a 80 char length. */" | tee -a src/init.cpp
```
Edit the init.cpp and add the following comment on the last line:
```
/* This comment is really too long, clang-format will cut it to a 80 char length. */
```
Amend the commit, run `arc scripted-diff`, it should return
`Scripted-diff check is successful`.
Run `arc lint` and amend the commit with the proposed change, the
comment should now be formatted on 2 lines.
Run `arc scripted-diff` again and check the output is the same:
Scripted-diff check is successful
Comment the line `"src/init.cpp:.*atoi"` in the file
`lint-locale-dependence.sh`, and amend to commit.
Now add an empty commit on top of this one, with a scripted-diff message
for the script `echo lint error`.
Run
arc scripted-diff
Should return
```
Error while linting the base commit. Fixes the issue then run `arc
scripted-diff` again.
```
Change the commit message to remove the scripted-diff content and run:
arc scripted-diff
It should return nothing.