Skip to content

Commit 9262585

Browse files
committed
Allow specifying sections for whats_left.sh
1 parent f8cf39e commit 9262585

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

whats_left.sh

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
33

4+
ALL_SECTIONS=(methods modules)
5+
46
GREEN=''
57
BOLD=''
68
NC='(B'
@@ -23,10 +25,19 @@ cd "$(dirname "$0")"
2325
# run whats_left_to_implement
2426
cargo build
2527

26-
whats_left_section() {
27-
h "$1"
28-
cargo run -q -- tests/snippets/whats_left_"$1".py
29-
}
28+
if [ $# -eq 0 ]; then
29+
sections=(${ALL_SECTIONS[@]})
30+
else
31+
sections=($@)
32+
fi
3033

31-
whats_left_section methods
32-
whats_left_section modules
34+
for section in "${sections[@]}"; do
35+
section=$(echo "$section" | tr "[:upper:]" "[:lower:]")
36+
snippet=tests/snippets/whats_left_$section.py
37+
if ! [[ -f $snippet ]]; then
38+
echo "Invalid section $section" >&2
39+
continue
40+
fi
41+
h "$section" >&2
42+
cargo run -q -- "$snippet"
43+
done

0 commit comments

Comments
 (0)