spark: add Python check script for factorial verification
This commit is contained in:
1 parent
b548099861
commit
09dfa0f132
1 file changed
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Check that factorial(7) equals 5040."""
|
||||||
|
import sys
|
||||||
|
sys.path.insert(0, '/root/.hermes/wizard-outputs/spark')
|
||||||
|
from verify_check import factorial
|
||||||
|
|
||||||
|
result = factorial(7)
|
||||||
|
expected = 5040
|
||||||
|
if result != expected:
|
||||||
|
print(f"FAIL: factorial(7) = {result}, expected {expected}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
print(f"PASS: factorial(7) = {result}")
|
||||||
|
sys.exit(0)
|
||||||
Reference in new issue
Block a user