Skip to content

Commit 2bcaf15

Browse files
committed
Format codes
1 parent fb47859 commit 2bcaf15

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/test-expand.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
TEST_MODULES=(convolution dsu fenwicktree lazysegtree math maxflow mincostflow modint scc segtree string twosat --all)
44
TMP_PATH=$(mktemp -d)
5-
SCRIPT_DIR=$(cd $(dirname $0); pwd)
5+
# shellcheck disable=SC2164
6+
SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd)"
67
TEST_FILE="test.rs"
78
FILE_HEAD="fn main() {}"
89

9-
for MODULE in ${TEST_MODULES[@]};do
10-
echo Test module $MODULE
11-
python3 $SCRIPT_DIR/../../expand.py $MODULE > $TMP_PATH/$TEST_FILE
12-
echo "Output" $(wc -c < $TMP_PATH/$TEST_FILE) "Bytes"
13-
echo $FILE_HEAD >> $TMP_PATH/$TEST_FILE
14-
rustc -A warnings $TMP_PATH/$TEST_FILE
15-
if [ $? -ne 0 ];then
16-
echo "Error compiling for $MODULE"
10+
for MODULE in "${TEST_MODULES[@]}" ;do
11+
echo Test module "$MODULE"
12+
python3 "$SCRIPT_DIR/../../expand.py" "$MODULE" > "$TMP_PATH/$TEST_FILE"
13+
echo Output "$(wc -c < "$TMP_PATH/$TEST_FILE")" Bytes
14+
echo "$FILE_HEAD" >> "$TMP_PATH/$TEST_FILE"
15+
if ! rustc -A warnings "$TMP_PATH/$TEST_FILE";
16+
then
17+
echo Error compiling for "$MODULE"
1718
exit 1
1819
else
19-
echo "Test passed"
20+
echo Test passed
2021
fi
2122
done

0 commit comments

Comments
 (0)