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

@@ -1,23 +0,0 @@
import std/strutils
from std/os import fileExists
import std/typetraits as typetraits2
from std/setutils import complement
proc fn1() = discard
proc fn2*() = discard
let fn4 = 0
let fn5* = 0
const fn7 = 0
const fn8* = 0
type T1 = object

View File

@@ -1,3 +0,0 @@
import mused2c
export mused2c

View File

@@ -1 +0,0 @@
proc baz*() = discard

View File

@@ -1,76 +0,0 @@
#[
ran from trunner
]#
# line 10
when defined case1:
from mused3a import nil
from mused3b import nil
mused3a.fn1()
when defined case2:
from mused3a as m1 import nil
m1.fn1()
when defined case3:
from mused3a import fn1
fn1()
when defined case4:
from mused3a as m1 import fn1
m1.fn1()
when defined case5:
import mused3a as m1
fn1()
when defined case6:
import mused3a except nonexistent
fn1()
when defined case7:
import mused3a
mused3a.fn1()
when defined case8:
# re-export test
import mused3a except nonexistent
gn1()
when defined case9:
# re-export test
import mused3a
gn1()
when defined case10:
#[
edge case which happens a lot in compiler code:
don't report UnusedImport for mused3b here even though it works without `import mused3b`,
because `a.b0.f0` is accessible from both mused3a and mused3b (fields are given implicit access)
]#
import mused3a
import mused3b
var a: Bar
discard a.b0.f0
when false:
when defined case11:
#[
xxx minor bug: this should give:
Warning: imported and not used: 'm2' [UnusedImport]
but doesn't, because currently implementation in `markOwnerModuleAsUsed`
only looks at `fn1`, not fully qualified call `m1.fn1()
]#
from mused3a as m1 import nil
from mused3a as m2 import nil
m1.fn1()
when defined case12:
import mused3a
import mused3a
fn1()

View File

@@ -1,41 +0,0 @@
when defined case1:
proc fn1*() = discard
when defined case2:
proc fn1*() = discard
when defined case3:
proc fn1*() = discard
proc fn2*() = discard
when defined case4:
proc fn1*() = discard
proc fn2*() = discard
when defined case5:
proc fn1*() = discard
when defined case6:
proc fn1*() = discard
when defined case7:
proc fn1*() = discard
when defined case8:
import mused3b
export mused3b
when defined case9:
import mused3b
export mused3b
when defined case10:
import mused3b
type Bar* = object
b0*: Foo
when defined case11:
proc fn1*() = discard
when defined case12:
proc fn1*() = discard

View File

@@ -1,12 +0,0 @@
when defined case1:
proc gn1*()=discard
when defined case8:
proc gn1*()=discard
when defined case9:
proc gn1*()=discard
when defined case10:
type Foo* = object
f0*: int

View File

@@ -1,46 +0,0 @@
discard """
matrix: "--hint:all:off --hint:XDeclaredButNotUsed --path:."
joinable: false
nimoutFull: true
nimout: '''
mused2a.nim(12, 6) Hint: 'fn1' is declared but not used [XDeclaredButNotUsed]
mused2a.nim(16, 5) Hint: 'fn4' is declared but not used [XDeclaredButNotUsed]
mused2a.nim(20, 7) Hint: 'fn7' is declared but not used [XDeclaredButNotUsed]
mused2a.nim(23, 6) Hint: 'T1' is declared but not used [XDeclaredButNotUsed]
mused2a.nim(1, 11) Warning: imported and not used: 'strutils' [UnusedImport]
mused2a.nim(3, 9) Warning: imported and not used: 'os' [UnusedImport]
mused2a.nim(5, 23) Warning: imported and not used: 'typetraits2' [UnusedImport]
mused2a.nim(6, 9) Warning: imported and not used: 'setutils' [UnusedImport]
tused2.nim(42, 8) Warning: imported and not used: 'mused2a' [UnusedImport]
tused2.nim(45, 11) Warning: imported and not used: 'strutils' [UnusedImport]
'''
"""
# line 40
import mused2a
import mused2b
import std/strutils
baz()