clean up deprecated stuff and unused imports in tests (#13059)

This commit is contained in:
Miran
2020-01-07 09:49:08 +01:00
committed by GitHub
parent 6a7a19eb15
commit 1551fff853
8 changed files with 15 additions and 16 deletions

View File

@@ -670,7 +670,7 @@ when isMainModule:
doAssert a[1] == 0
doAssert rand(0) == 0
doAssert rand("a") == 'a'
doAssert sample("a") == 'a'
when compileOption("rangeChecks"):
try:

View File

@@ -2,7 +2,7 @@ discard """
action: run
"""
import math, random, strutils
import random, strutils
const consolePrefix = "jsCallbacks"
asm """
@@ -33,8 +33,8 @@ proc runCallbacks ():cstring {.importc.}
proc `*` (s:string, n:Natural) : string = s.repeat(n)
proc outer (i:Natural) : (string, int) =
let c = $char(random(93) + 33)
let n = random(40)
let c = $char(rand(93) + 33)
let n = rand(40)
let s = c * n
proc inner(): cstring = ("[$1]" % $n) & s & " <--"
regCallback(inner)
@@ -92,4 +92,4 @@ block issue7048:
let f = foo(p)
p = addr s2
doAssert len(p[]) == 5
doAssert f() == 3
doAssert f() == 3

View File

@@ -4,8 +4,7 @@ discard """
# This file tests the JavaScript generator
import
dom, strutils
import strutils
var
inputElement = "1123"
@@ -51,4 +50,3 @@ block:
var s: seq[int]
s.add(2)
doAssert(s == @[2])

View File

@@ -35,7 +35,7 @@ true
## same as tjsffi, but this test uses the old names: importc and
## importcpp. This test is for backwards compatibility.
import macros, jsffi, jsconsole
import jsffi, jsconsole
# Tests for JsObject
# Test JsObject []= and []
@@ -299,7 +299,6 @@ block:
test()
import macros
block:
{.emit:

View File

@@ -1,5 +1,5 @@
type
TObj* = object {.inheritable.}
TObj* {.inheritable.} = object
var myObj* : ref TObj

View File

@@ -9,7 +9,7 @@ hello
# tmultim1
type
Expression = ref object {.inheritable.}
Expression {.inheritable.} = ref object
Literal = ref object of Expression
x: int
PlusExpr = ref object of Expression
@@ -69,4 +69,4 @@ var s:ref Test = newTest()
#doesn't work
for z in 1..4:
s.doMethod()
break
break

View File

@@ -5,7 +5,7 @@ discard """
'''
"""
from future import `->`, `=>`
from sugar import `->`, `=>`
from math import `^`, sum
from sequtils import filter, map, toSeq
@@ -14,4 +14,4 @@ proc f: int =
var a = f()
echo a
echo a

View File

@@ -4,10 +4,12 @@ discard """
"""
import math
import strformat
const manualTest = false
when manualTest:
import strformat
proc frexp_test(lo, hi, step: float64) =
var exp: int
var frac: float64