put several issues in tests (#9352)
* put several issues in tests * remove wrong test
This commit is contained in:
parent
e435dbd35e
commit
d570dea480
1 changed files with 57 additions and 11 deletions
|
|
@ -15,6 +15,7 @@ f
|
||||||
5
|
5
|
||||||
()
|
()
|
||||||
false
|
false
|
||||||
|
10
|
||||||
true
|
true
|
||||||
true
|
true
|
||||||
true
|
true
|
||||||
|
|
@ -30,7 +31,7 @@ Meow
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import macros, typetraits
|
import macros, typetraits, os, posix
|
||||||
|
|
||||||
|
|
||||||
block t5983:
|
block t5983:
|
||||||
|
|
@ -320,6 +321,51 @@ block t6691:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
block t6782:
|
||||||
|
type
|
||||||
|
Reader = concept c
|
||||||
|
c.read(openarray[byte], int, int) is int
|
||||||
|
Rdr = concept c
|
||||||
|
c.rd(openarray[byte], int, int) is int
|
||||||
|
|
||||||
|
type TestFile = object
|
||||||
|
|
||||||
|
proc read(r: TestFile, dest: openarray[byte], offset: int, limit: int): int =
|
||||||
|
result = 0
|
||||||
|
proc rd(r: TestFile, dest: openarray[byte], offset: int, limit: int): int =
|
||||||
|
result = 0
|
||||||
|
|
||||||
|
doAssert TestFile is Reader
|
||||||
|
doAssert TestFile is Rdr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
block t7114:
|
||||||
|
type
|
||||||
|
MyConcept = concept x
|
||||||
|
x.close() # error, doesn't work
|
||||||
|
MyConceptImplementer = object
|
||||||
|
|
||||||
|
proc close(self: MyConceptImplementer) = discard
|
||||||
|
proc takeConcept(window: MyConcept) =
|
||||||
|
discard
|
||||||
|
|
||||||
|
takeConcept(MyConceptImplementer())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
block t7510:
|
||||||
|
type
|
||||||
|
A[T] = concept a
|
||||||
|
a.x is T
|
||||||
|
B[T] = object
|
||||||
|
x: T
|
||||||
|
proc getx(v: A): v.T = v.x
|
||||||
|
var v = B[int32](x: 10)
|
||||||
|
echo v.getx
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
block misc_issues:
|
block misc_issues:
|
||||||
# https://github.com/nim-lang/Nim/issues/1147
|
# https://github.com/nim-lang/Nim/issues/1147
|
||||||
type TTest = object
|
type TTest = object
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue