typo: nonexistant => nonexistent (#17918)

* typo: nonexistant => nonexistent

* fix test (ordering differs because of https://github.com/nim-lang/Nim/issues/17910)
This commit is contained in:
Timothee Cour
2021-05-01 15:26:41 -07:00
committed by GitHub
parent 13b57524d3
commit 78e2d299df
16 changed files with 38 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
# https://github.com/nim-lang/Nim/issues/13524
template fun(field): untyped = astToStr(field)
proc test1(): string = fun(nonexistant1)
proc test2[T](): string = fun(nonexistant2) # used to cause: Error: undeclared identifier: 'nonexistant2'
doAssert test1() == "nonexistant1"
doAssert test2[int]() == "nonexistant2"
proc test1(): string = fun(nonexistent1)
proc test2[T](): string = fun(nonexistent2) # used to cause: Error: undeclared identifier: 'nonexistent2'
doAssert test1() == "nonexistent1"
doAssert test2[int]() == "nonexistent2"

View File

@@ -6,7 +6,7 @@ doAssert declared(m2.foo0) # public: works fine
doAssert m2.foo1 == 2
doAssert declared(m2.foo1)
doAssert not declared(m2.nonexistant)
doAssert not declared(m2.nonexistent)
# also tests the quoted `""` import
import "."/"m1" {.all.} as m1b

View File

@@ -136,8 +136,8 @@ template main =
macro deb1(a): untyped = newLit a.repr
macro deb2(a): untyped = newLit a.lispRepr
doAssert deb1(-12'wrap) == "-12'wrap"
doAssert deb1(-12'nonexistant) == "-12'nonexistant"
doAssert deb2(-12'nonexistant) == """(DotExpr (RStrLit "-12") (Ident "\'nonexistant"))"""
doAssert deb1(-12'nonexistent) == "-12'nonexistent"
doAssert deb2(-12'nonexistent) == """(DotExpr (RStrLit "-12") (Ident "\'nonexistent"))"""
when false: # xxx bug:
# this holds:
doAssert deb2(-12.wrap2) == """(DotExpr (IntLit -12) (Sym "wrap2"))"""

View File

@@ -93,7 +93,7 @@ when true: # runnableExamples with rdoccmd
template fun3Impl(): untyped =
runnableExamples(rdoccmd="-d:foo"):
nonexistant
nonexistent
# bugfix: this shouldn't be semchecked when `runnableExamples`
# has more than 1 argument
discard
@@ -126,7 +126,7 @@ runnableExamples:
block:
template fn(body: untyped): untyped = true
doAssert(fn do: nonexistant)
doAssert(fn do: nonexistent)
import std/macros
macro foo*(x, y) =
result = newLetStmt(x[0][0], x[0][1])

View File

@@ -38,7 +38,7 @@ block fileOperations:
doAssert dirExists(dname)
block: # copyFile, copyFileToDir
doAssertRaises(OSError): copyFile(dname/"nonexistant.txt", dname/"nonexistant.txt")
doAssertRaises(OSError): copyFile(dname/"nonexistent.txt", dname/"nonexistent.txt")
let fname = "D20201009T112235"
let fname2 = "D20201009T112235.2"
let str = "foo1\0foo2\nfoo3\0"
@@ -164,7 +164,7 @@ block fileOperations:
const subDir2 = dname/"sub2"
const brokenSymlinkName = "D20210101T191320_BROKEN_SYMLINK"
const brokenSymlink = dname/brokenSymlinkName
const brokenSymlinkSrc = "D20210101T191320_nonexistant"
const brokenSymlinkSrc = "D20210101T191320_nonexistent"
const brokenSymlinkCopy = brokenSymlink & "_COPY"
const brokenSymlinkInSubDir = subDir/brokenSymlinkName
const brokenSymlinkInSubDir2 = subDir2/brokenSymlinkName
@@ -296,9 +296,9 @@ block walkDirRec:
block: # walkDir
doAssertRaises(OSError):
for a in walkDir("nonexistant", checkDir = true): discard
for a in walkDir("nonexistent", checkDir = true): discard
doAssertRaises(OSError):
for p in walkDirRec("nonexistant", checkDir = true): discard
for p in walkDirRec("nonexistent", checkDir = true): discard
when not defined(windows):
block walkDirRelative:

View File

@@ -272,10 +272,10 @@ else: # main driver
stripLineEnd(result[0])
doAssert result == ("12", 0)
when not defined(windows):
doAssert execCmdEx("ls --nonexistant").exitCode != 0
doAssert execCmdEx("ls --nonexistent").exitCode != 0
when false:
# bug: on windows, this raises; on posix, passes
doAssert execCmdEx("nonexistant").exitCode != 0
doAssert execCmdEx("nonexistent").exitCode != 0
when defined(posix):
doAssert execCmdEx("echo $FO", env = newStringTable({"FO": "B"})) == ("B\n", 0)
doAssert execCmdEx("echo $PWD", workingDir = "/") == ("/\n", 0)

View File

@@ -142,7 +142,7 @@ suite "YAML syntax highlighting":
test "Directives: warnings":
let input = dedent"""
.. non-existant-warning: Paragraph.
.. non-existent-warning: Paragraph.
.. another.wrong:warning::: Paragraph.
"""
@@ -151,7 +151,7 @@ suite "YAML syntax highlighting":
check output == ""
doAssert warnings[].len == 2
check "(1, 24) Warning: RST style:" in warnings[0]
check "double colon :: may be missing at end of 'non-existant-warning'" in warnings[0]
check "double colon :: may be missing at end of 'non-existent-warning'" in warnings[0]
check "(3, 25) Warning: RST style:" in warnings[1]
check "RST style: too many colons for a directive (should be ::)" in warnings[1]

View File

@@ -94,5 +94,5 @@ block: # typeof(stmt)
doAssert not compiles(bad1())
block:
template bad2 = echo (nonexistant; discard)
template bad2 = echo (nonexistent; discard)
doAssert not compiles(bad2())

View File

@@ -119,11 +119,11 @@ template main() =
block:
# shows that iterable is more restrictive than untyped
reject fn8a(nonexistant)
accept fn7b(nonexistant)
reject fn7c(nonexistant)
reject fn7d(nonexistant)
reject fn7e(nonexistant)
reject fn8a(nonexistent)
accept fn7b(nonexistent)
reject fn7c(nonexistent)
reject fn7d(nonexistent)
reject fn7e(nonexistent)
doAssert toSeq5(iota(3)) == expected1
reject toSeq5(myiter(2))

View File

@@ -16,7 +16,7 @@ static:
let ret = gorgeEx(nim & " --version")
doAssert ret.exitCode == 0
doAssert ret.output.contains "Nim Compiler"
let ret2 = gorgeEx(nim & " --unexistant")
let ret2 = gorgeEx(nim & " --nonxistent")
doAssert ret2.exitCode != 0
let output3 = gorge(nim & " --version")
doAssert output3.contains "Nim Compiler"
@@ -43,4 +43,4 @@ block:
# Check against bugs like #9176
doAssert getCurrentCompilerExe() == getCurrentCompilerExe().static
if false: #pending #9176
doAssert gorgeEx("unexistant") == gorgeEx("unexistant").static
doAssert gorgeEx("nonxistent") == gorgeEx("nonxistent").static