Skip to content

Commit

Permalink
fix tests, test_iterator_typed still broken nim-lang/Nim#24075
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 7, 2024
1 parent 118059c commit 3191bd6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/applicates/internals.nim
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ proc arity*(appl: Applicate): int {.compileTime.} =
## gets arity of applicate. check `inferArity` for meaning of
## negative values
runnableExamples:
import ../applicates, ./operators
import applicates, applicates/operators
doAssert static(arity((x, y) ==> x + y)) == 2
doAssert static(arity(a ==> a)) == 1
doAssert static(arity(==> 3)) == 0
Expand Down
8 changes: 4 additions & 4 deletions src/applicates/operators.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ macro `\`*(call: untyped): untyped =
## supports dot calls, if the given expression is not a dot expression
## or call or command then it will simply apply it with no arguments
runnableExamples:
import ../applicates
import applicates
const foo = x ==> x + 1
doAssert \foo(1) == 2
doAssert \1.foo == 2
Expand All @@ -49,7 +49,7 @@ macro `|>`*(value, call): untyped =
##
## if call is a dot call, it is not modified, so value becomes the second argument in the call
runnableExamples:
import ../applicates
import applicates

const incr = toApplicate(system.succ)
const multiply = toApplicate(`*`)
Expand All @@ -65,7 +65,7 @@ macro `|>`*(value, call): untyped =
macro `\>`*(value, call): untyped =
## same as `|>` except allows multiple arguments for `value` in the form of ``(a, b)``
runnableExamples:
import ../applicates
import applicates

const incr = toApplicate(system.succ)
const multiply = toApplicate(`*`)
Expand All @@ -87,7 +87,7 @@ macro `\>`*(value, call): untyped =
macro chain*(initial, calls): untyped =
## statement list chained version of `|>`
runnableExamples:
import ../applicates
import applicates

const incr = toApplicate(system.succ)
const multiply = toApplicate(`*`)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_basic.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test "applicate macro and apply":

foo.apply(5, FooType)
check x.field == 5
check not compiles(x is FooType) # gensym'd
check x is FooType

const incr = applicate do (x: int) -> int: x + 1
doAssert incr.apply(x.field) == 6
Expand Down Expand Up @@ -86,7 +86,7 @@ test "map test":

test "toCallerApplicate":
const adder = toCallerApplicate(`+`, 2)
const toString = toCallerApplicate(`$`)
const toString = toCallerApplicate(`$`, 1)
check \adder(2, 3) |> toString == "5"

test "toApplicate":
Expand Down

0 comments on commit 3191bd6

Please sign in to comment.