Skip to content

Commit

Permalink
closes nim-lang#20704; add a test case (nim-lang#21480)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored and capocasa committed Mar 31, 2023
1 parent f38c61c commit 20fc7c1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/stdlib/tsugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ discard """
x + y = 30
'''
"""
import std/[sugar, algorithm, random, sets, tables, strutils]
import std/[sugar, algorithm, random, sets, tables, strutils, sequtils]
import std/[syncio, assertions]

type # for capture test, ref #20679
Expand Down Expand Up @@ -287,6 +287,17 @@ proc mainProc() =
doAssertRaises(AssertionDefect): doAssert false
doAssert "except AssertionDefect" in s2

block: # bug #20704
proc test() =
var xs, ys: seq[int]
for i in 0..5:
xs.add(i)

xs.apply(d => ys.add(d))
doAssert ys == @[0, 1, 2, 3, 4, 5]

test()

static:
main()
mainProc()
Expand Down

0 comments on commit 20fc7c1

Please sign in to comment.