Merge remote-tracking branch 'upstream/devel' into pr-remove-encode-overload

This commit is contained in:
AmjadHD
2022-10-02 13:28:06 +01:00
9 changed files with 36 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ define:booting
define:nimcore
define:nimPreviewFloatRoundtrip
define:nimPreviewSlimSystem
threads:off
#import:"$projectpath/testability"

View File

@@ -97,6 +97,10 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
if not self.loadConfigsAndProcessCmdLine(cache, conf, graph):
return
if conf.cmd == cmdCheck and optWasNimscript notin conf.globalOptions and
conf.backend == backendInvalid:
conf.backend = backendC
if conf.selectedGC == gcUnselected:
if conf.backend in {backendC, backendCpp, backendObjc}:
initOrcDefines(conf)

7
tests/arc/t20456.nim Normal file
View File

@@ -0,0 +1,7 @@
discard """
cmd: "nim check $file"
action: "compile"
"""
when not defined(gcOrc):
{.error: "orc".}

View File

@@ -177,16 +177,14 @@ block tableconstr:
block ttables2:
proc TestHashIntInt() =
var tab = initTable[int,int]()
let n = 100_000
let n = 10
for i in 1..n:
tab[i] = i
for i in 1..n:
var x = tab[i]
if x != i : echo "not found ", i
proc run1() =
for i in 1 .. 50:
TestHashIntInt()
TestHashIntInt()
# bug #2107
@@ -198,7 +196,6 @@ block ttables2:
delTab[5] = 5
run1()
echo "2"
block tablesref:

View File

@@ -1,5 +1,5 @@
discard """
cmd: "nim check --showAllMismatches:on --hints:off $file"
cmd: "nim check --mm:refc --showAllMismatches:on --hints:off $file"
nimout: '''
tsigmatch.nim(111, 4) Error: type mismatch: got <A, string>
but expected one of:

View File

@@ -1,9 +1,9 @@
discard """
output: '''
312
1000000
1000000
500000
1000
1000
500
0
'''
"""
@@ -445,7 +445,7 @@ proc test() =
var it1 = internalFind(root, 312)
echo it1.value
for i in 1..1_000_000:
for i in 1..1_000:
root = internalPut(root, i, i, oldvalue)
var cnt = 0

1
tests/misc/m20456.nims Normal file
View File

@@ -0,0 +1 @@
echo 123

14
tests/misc/t20456_2.nim Normal file
View File

@@ -0,0 +1,14 @@
discard """
joinable: false
"""
import std/[osproc, os, strformat]
from stdtest/specialpaths import testsDir
when defined(nimPreviewSlimSystem):
import std/assertions
const
nim = getCurrentCompilerExe()
file = testsDir / "misc" / "m20456.nims"
doAssert execCmd(fmt"{nim} check {file}") == 0

View File

@@ -1,4 +1,3 @@
import unittest
type Obj = object
foo: int
@@ -10,9 +9,9 @@ block: # object basic methods
block: # it should convert an object to a string
var obj = makeObj(1)
# Should be "obj: (foo: 1)" or similar.
check($obj == "(foo: 1)")
doAssert($obj == "(foo: 1)")
block: # it should test equality based on fields
check(makeObj(1) == makeObj(1))
doAssert(makeObj(1) == makeObj(1))
# bug #10203