File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # set -e
3
-
4
- EXPECTED=' (x): number => 123\n'
5
- ACTUAL=$( echo ' ( \n x ) : number => 123 ' | /usr/bin/env node index.js -assume-filename a.js)
6
- if [[ " $ACTUAL " = " $EXPECTED " ]]; then
7
- echo " [FAIL] Expected $EXPECTED , got $ACTUAL " >&2
8
- exit 1
9
- fi
2
+ set -e
10
3
11
4
# Make sure we can run on relative an absolute paths (set -e checks for errors).
12
5
/usr/bin/env node index.js index.js > /dev/null
@@ -21,7 +14,7 @@ EXPECTED_GLOB_STRING="ran google-java-format on 2 files" # somewhere in there
21
14
22
15
(
23
16
cd " $PWD " /testproject
24
- yarn > /dev/null # Should give us a local clang -format, version doesn't really matter.
17
+ yarn > /dev/null # Should give us a local google-java -format, version doesn't really matter.
25
18
VERSION=$( /usr/bin/env node " $FULL_SCRIPT_PATH " -version)
26
19
if [[ $VERSION != * " $EXPECTED_VERSION_STRING " * ]]; then
27
20
echo " [FAIL] Expected string containing $EXPECTED_VERSION_STRING , got $VERSION " >&2
49
42
echo " [PASS] glob argument resolution" >&2
50
43
51
44
echo " (The next output lines will be an expected error, as we test error codes)"
45
+ set +e
52
46
eval " /usr/bin/env node $FULL_SCRIPT_PATH --set-exit-if-changed -n --glob=testproject/**/*.java"
53
47
if [ " $? " != 1 ]; then
54
48
echo " [FAIL] Expected return status to be 1, got $? " >&2
You can’t perform that action at this time.
0 commit comments