File: timports.nim

package info (click to toggle)
nim 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,911,644 kB
  • sloc: sh: 24,603; ansic: 1,761; python: 1,492; makefile: 1,013; sql: 298; asm: 141; xml: 13
file content (63 lines) | stat: -rw-r--r-- 1,209 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
discard """
  output: '''
317
TEST2
5 5 5
false
'''
"""

import mbind_bracket, mclosed_sym, mdotlookup, mmodule_same_as_proc, mtypenodes


block tbind_bracket:
  # bug #2599
  # also test that `[]` can be passed now as a first class construct:

  template takeBracket(x, a, i: untyped) =
    echo x(a, i)

  var a: array[10, int]
  a[8] = 317

  takeBracket(`[]`, a, 8)

  let reg = newRegistry[UUIDObject]()
  reg.register(UUIDObject())


block tclosed_sym:
  # bug #2664
  proc same(r:R, d:int) = echo "TEST1"
  doIt(Data[int](d:123), R())

import strutils, unicode # ambiguous `strip`

block tdotlookup:
  foo(7)
  # bug #1444
  fn(4)
  doAssert doStrip(123) == "123"
  # bug #14254
  doAssert baz2[float](1'i8) == 1
  # bug #21883
  proc abc[T: not not int](x: T): T =
    var x = x
    x.set("hello", "world")
    result = x
  doAssert abc(5) == 10
  block: # ensure normal call is consistent with dot call 
    proc T(x: int): float = x.float
    proc foo[T](x: int) =
      doAssert typeof(T(x)) is typeof(x.T)
    foo[uint](123)

block tmodule_same_as_proc:
  # bug #1965
  proc test[T](t: T) =
    mmodule_same_as_proc"a"
  test(0)

block ttypenodes:
  # issue #22699
  doAssert chop[bool](42) == 42