mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-10 13:48:10 +00:00
clean up deprecated stuff and unused imports in tests (#13059)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
type
|
||||
TObj* = object {.inheritable.}
|
||||
TObj* {.inheritable.} = object
|
||||
|
||||
var myObj* : ref TObj
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user