some test cleanups & category reorganization (#22010)

* clean up some test categories

* mention exact slice issue

* magics into system

* move trangechecks into overflow

* move tmemory to system

* try fix CI

* try fix CI

* final CI fix
This commit is contained in:
metagn
2023-06-06 07:54:07 +03:00
committed by GitHub
parent 2ab948ce53
commit b97d603cd0
134 changed files with 189 additions and 374 deletions

View File

@@ -0,0 +1,11 @@
type
TMyObj = object
x: int
proc gen*[T](): T =
var d: TMyObj
# access private field here
d.x = 3
result = d.x

View File

@@ -0,0 +1,16 @@
discard """
errormsg: "type mismatch: got <int literal(232)>"
line: 16
"""
proc myGenericProc[T: object|tuple|ptr|ref|distinct](x: T): string =
result = $x
type
TMyObj = tuple[x, y: int]
var
x: TMyObj
assert myGenericProc(x) == "(x: 0, y: 0)"
assert myGenericProc(232) == "232"

View File

@@ -0,0 +1,11 @@
discard """
output: "3"
"""
# Tests that a generic instantiation from a different module may access
# private object fields:
import mfriends
echo gen[int]()

View File

@@ -1,7 +1,3 @@
discard """
exitcode: 0
disabled: '''true'''
"""
import moverloading_typedesc
import tables
@@ -9,7 +5,6 @@ type
LFoo = object
LBar = object
when true:
doAssert FBar.new() == 3