Skip to content

Commit ce22deb

Browse files
committed
fail if errror message
1 parent fd8ed43 commit ce22deb

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/funcs.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ elemental real(wp) FUNCTION RIEMANNZETA (S,EPS)
446446

447447
NSTERM = S*(S+1)*(S+2)* &
448448
(S+3)*(S+4)/30240
449-
N = int((NSTERM*(2**S)/EPS)**(1._wp/(S+5)))
449+
N = int((NSTERM*(2**S)/EPS)**(1 / (S+5)))
450450
IF ( N < 10 ) THEN
451451
N = 10
452452
END IF
@@ -461,7 +461,7 @@ elemental real(wp) FUNCTION RIEMANNZETA (S,EPS)
461461

462462
! Add Euler-Maclaurin correction terms
463463
SUM = SUM+(FN**NEGS)*(0.5D00+FN/(S-1) &
464-
+S*(1._wp-(S+ 1._wp)*(S+2)/ &
464+
+S*(1 - (S + 1)*(S+2)/ &
465465
(60*FN*FN)) &
466466
/(12*FN))+NSTERM/(FN**(S+5))
467467
riemannZETA = SUM

tests/test_functions.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ def frun(name: str, args) -> float:
2222
if not isinstance(args, (list, tuple)):
2323
args = [args]
2424
input = "\n".join(map(str, args)) + "\n" + name
25-
raw = subprocess.check_output([EXE], input=input, text=True, timeout=5)
26-
return float(raw.strip().split("\n")[-1])
25+
raw = subprocess.run([EXE], capture_output=True, input=input, text=True, timeout=5)
26+
assert not raw.stderr, raw.stderr
27+
return float(raw.stdout.strip().split("\n")[-1])
2728

2829

2930
def test_bessel0():
@@ -56,5 +57,10 @@ def test_bessel_general():
5657
assert frun(k, a) == approx(f(*a))
5758

5859

60+
def test_riemann_zeta():
61+
62+
assert frun("rzeta", (2)) == approx(sp.zeta(2))
63+
64+
5965
if __name__ == "__main__":
6066
pytest.main([__file__])

0 commit comments

Comments
 (0)