summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
authorAndrii Riabushenko <cdome@bk.ru>2018-12-07 22:25:32 +0000
committerAndrii Riabushenko <cdome@bk.ru>2018-12-07 22:25:32 +0000
commit43c70a6b12e24a6eed6e8b93cf21f225cef912da (patch)
treee21cf2f6afaaa666cff02ab0dfdf3e77b5fbef96 /tests/destructor
parentd9815574c0ac38cf832515c0034ff2be96da24d9 (diff)
downloadNim-43c70a6b12e24a6eed6e8b93cf21f225cef912da.tar.gz
improve test
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tmove_objconstr.nim11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/destructor/tmove_objconstr.nim b/tests/destructor/tmove_objconstr.nim
index 05562d5e0..51aba1592 100644
--- a/tests/destructor/tmove_objconstr.nim
+++ b/tests/destructor/tmove_objconstr.nim
@@ -115,8 +115,13 @@ proc myfunc2(x, y: int): tuple[a: MySeqNonCopyable, b:int, c:MySeqNonCopyable] =
       z2
     elif x > 5: raise newException(ValueError, "new error")
     else: newMySeq(x, 1.0), 
-   b:0, 
-   c: if y > 0: move(cc) else: newMySeq(1, 3.0))
+   b: 0, 
+   c: block:
+        var tmp = if y > 0: move(cc) else: newMySeq(1, 3.0)
+        tmp[0] = 5
+        tmp 
+  )
+   
 
 let (seq1, seq2) = myfunc(2, 3)
 doAssert seq1.len == 2
@@ -160,4 +165,4 @@ seq4 =
 
 var ii = 1
 let arr2 = [newMySeq(2, 5.0), if i > 1: newMySeq(3, 1.0) else: newMySeq(0, 0.0)]
-var seqOfSeq2 = @[newMySeq(2, 5.0), newMySeq(3, 1.0)]
\ No newline at end of file
+var seqOfSeq2 = @[newMySeq(2, 5.0), newMySeq(3, 1.0)]