Skip to content

Commit beb9173

Browse files
committed
factor: Add test script
1 parent dc8af08 commit beb9173

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/factor.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
3+
set -eux
4+
5+
start="$(date -u +%s)"
6+
7+
for n in $(seq 0 1000); do
8+
test "$(./factor.py "${n}")" = "$(factor "${n}")"
9+
done
10+
11+
end="$(date -u +%s)"
12+
printf '%.1f s elapsed\n' $(( end - start ))
13+
14+
exit 0

0 commit comments

Comments
 (0)