Skip to content

Commit

Permalink
Run runnableExamples in CI (nim-lang#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
konsumlamm authored May 17, 2022
1 parent 910f7ff commit d843ecf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions bigints.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ task test, "Test bigints":
echo " using " & gc & " GC"
for file in ["tbigints.nim", "tbugs.nim"]:
exec "nim r --hints:off --experimental:strictFuncs --backend:" & backend & " --gc:" & gc & " tests/" & file
exec "nim doc --hints:off --backend:" & backend & " --gc:" & gc & " src/bigints.nim"

task checkExamples, "Check examples":
echo "checking examples"
Expand Down
2 changes: 1 addition & 1 deletion src/bigints.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ func invmod*(a, modulus: BigInt): BigInt =
## Compute the modular inverse of `a` modulo `modulus`.
## The return value is always in the range `[1, modulus-1]`
runnableExamples:
invmod(3.initBigInt, 7.initBigInt) = 5.initBigInt
assert invmod(3.initBigInt, 7.initBigInt) == 5.initBigInt

# extended Euclidean algorithm
if modulus.isZero:
Expand Down

0 comments on commit d843ecf

Please sign in to comment.