summary refs log tree commit diff stats
path: root/tests/stdlib/tunittesttemplate.nim
blob: 2ca50a18b3d5038e289b5f287cd40d12bd8007fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
discard """
  exitcode: 1
  outputsub: '''
    tunittesttemplate.nim(20, 12): Check failed: a.b == 2
    a.b was 0
  [FAILED] 1
'''
"""


# bug #6736

import unittest

type
  A = object
    b: int

template t: untyped =
  check(a.b == 2)

suite "1":
  test "1":
    var a = A(b: 0)
    t()
ey: int): T {.importcpp: "(#[#])", nodecl.} proc main = var v: Vector[float] v.setLen 1 v[0] = 6.0 echo v[0] main() #------------ #bug #6837 type StdString {.importCpp: "std::string", header: "<string>", byref.} = object proc initString(): StdString {.constructor, importCpp: "std::string(@)", header: "<string>".} proc size(this: var StdString): csize {.importCpp: "size", header: "<string>".} proc f(): csize = var myString: StdString = initString() return myString.size() echo f()