Merge tests into a larger file (part 5 of ∞) (#9368)
* merge magics * merge metatype tests * merge method tests * merge objects tests * change `import future` to `import sugar` Nim in Action tests are left with `import future`, to ensure compatibility. * merge overload tests * merge proc tests * merge procvar tests * merge range tests * merge seq tests * merge sets tests * remove wrong assert from `tsets3` * fix `jsTests` * better fix
This commit is contained in:
parent
f04c93b5dd
commit
749dbce4c6
96 changed files with 1763 additions and 1815 deletions
31
tests/proc/tproc.nim
Normal file
31
tests/proc/tproc.nim
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
discard """
|
||||
output: '''
|
||||
Hello
|
||||
1
|
||||
'''
|
||||
"""
|
||||
|
||||
|
||||
block t8357:
|
||||
type T = ref int
|
||||
|
||||
let r = new(string)
|
||||
r[] = "Hello"
|
||||
echo r[]
|
||||
|
||||
|
||||
block t8683:
|
||||
proc foo[T](bar: proc (x, y: T): int = system.cmp, baz: int) =
|
||||
echo "1"
|
||||
proc foo[T](bar: proc (x, y: T): int = system.cmp) =
|
||||
echo "2"
|
||||
|
||||
foo[int](baz = 5)
|
||||
|
||||
|
||||
block tnestprc:
|
||||
proc Add3(x: int): int =
|
||||
proc add(x, y: int): int {.noconv.} =
|
||||
result = x + y
|
||||
result = add(x, 3)
|
||||
doAssert Add3(7) == 10
|
||||
Loading…
Add table
Add a link
Reference in a new issue