Skip to content

Commit

Permalink
typo: nonexistant => nonexistent (nim-lang#17918)
Browse files Browse the repository at this point in the history
* typo: nonexistant => nonexistent

* fix test (ordering differs because of nim-lang#17910)
  • Loading branch information
timotheecour authored May 1, 2021
1 parent 13b5752 commit 78e2d29
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion lib/pure/osproc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ proc execCmdEx*(command: string, options: set[ProcessOption] = {
## import std/[strutils, strtabs]
## stripLineEnd(result[0]) ## portable way to remove trailing newline, if any
## doAssert result == ("12", 0)
## doAssert execCmdEx("ls --nonexistant").exitCode != 0
## doAssert execCmdEx("ls --nonexistent").exitCode != 0
## when defined(posix):
## assert execCmdEx("echo $FO", env = newStringTable({"FO": "B"})) == ("B\n", 0)
## assert execCmdEx("echo $PWD", workingDir = "/") == ("/\n", 0)
Expand Down
2 changes: 1 addition & 1 deletion lib/pure/sugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ macro dumpToString*(x: untyped): string =
assert dumpToString(a + x) == "a + x: 1 + x = 11"
template square(x): untyped = x * x
assert dumpToString(square(x)) == "square(x): x * x = 100"
assert not compiles dumpToString(1 + nonexistant)
assert not compiles dumpToString(1 + nonexistent)
import std/strutils
assert "failedAssertImpl" in dumpToString(assert true) # example with a statement
result = newCall(bindSym"dumpToStringImpl")
Expand Down
14 changes: 7 additions & 7 deletions nimdoc/testproject/expected/testproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ <h1 class="title">testproject</h1>
<li><a class="reference" href="#z11"
title="z11()">z11()</a></li>

</ul>
<ul class="simple nested-toc-section">c_nonexistent
<li><a class="reference" href="#c_nonexistent%2Ccstring"
title="c_nonexistent(frmt: cstring): cint">c_nonexistent(frmt: cstring): cint</a></li>

</ul>
<ul class="simple nested-toc-section">buzz
<li><a class="reference" href="#buzz%2CT%2CT"
Expand Down Expand Up @@ -292,11 +297,6 @@ <h1 class="title">testproject</h1>
<li><a class="reference" href="#asyncFun2"
title="asyncFun2(): owned(Future[void])">asyncFun2(): owned(Future[void])</a></li>

</ul>
<ul class="simple nested-toc-section">c_nonexistant
<li><a class="reference" href="#c_nonexistant%2Ccstring"
title="c_nonexistant(frmt: cstring): cint">c_nonexistant(frmt: cstring): cint</a></li>

</ul>
<ul class="simple nested-toc-section">asyncFun1
<li><a class="reference" href="#asyncFun1"
Expand Down Expand Up @@ -753,8 +753,8 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
the c printf. etc.

</dd>
<a id="c_nonexistant,cstring"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#c_nonexistant%2Ccstring"><span class="Identifier">c_nonexistant</span></a><span class="Other">(</span><span class="Identifier">frmt</span><span class="Other">:</span> <span class="Identifier">cstring</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">cint</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;nonexistant&quot;</span><span class="Other">,</span>
<a id="c_nonexistent,cstring"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#c_nonexistent%2Ccstring"><span class="Identifier">c_nonexistent</span></a><span class="Other">(</span><span class="Identifier">frmt</span><span class="Other">:</span> <span class="Identifier">cstring</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">cint</span> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;nonexistent&quot;</span><span class="Other">,</span>
<span class="Identifier">header</span><span class="Other">:</span> <span class="StringLit">&quot;&lt;stdio.h&gt;&quot;</span><span class="Other">,</span> <span class="Identifier">varargs</span><span class="Other">,</span> <span class="Identifier">discardable</span>.}</pre></dt>
<dd>

Expand Down
2 changes: 1 addition & 1 deletion nimdoc/testproject/expected/testproject.idx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ z17 testproject.html#z17 testproject: z17()
p1 testproject.html#p1 testproject: p1()
addfBug14485 testproject.html#addfBug14485 testproject: addfBug14485()
c_printf testproject.html#c_printf,cstring testproject: c_printf(frmt: cstring): cint
c_nonexistant testproject.html#c_nonexistant,cstring testproject: c_nonexistant(frmt: cstring): cint
c_nonexistent testproject.html#c_nonexistent,cstring testproject: c_nonexistent(frmt: cstring): cint
low testproject.html#low,T testproject: low[T: Ordinal | enum | range](x: T): T
low2 testproject.html#low2,T testproject: low2[T: Ordinal | enum | range](x: T): T
tripleStrLitTest testproject.html#tripleStrLitTest testproject: tripleStrLitTest()
Expand Down
4 changes: 2 additions & 2 deletions nimdoc/testproject/expected/theindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ <h1 class="title">Index</h1>
<li><a class="reference external"
data-doc-search-tag="Shapes.Circle" href="testproject.html#Circle">Shapes.Circle</a></li>
</ul></dd>
<dt><a name="c_nonexistant" href="#c_nonexistant"><span>c_nonexistant:</span></a></dt><dd><ul class="simple">
<dt><a name="c_nonexistent" href="#c_nonexistent"><span>c_nonexistent:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="testproject: c_nonexistant(frmt: cstring): cint" href="testproject.html#c_nonexistant%2Ccstring">testproject: c_nonexistant(frmt: cstring): cint</a></li>
data-doc-search-tag="testproject: c_nonexistent(frmt: cstring): cint" href="testproject.html#c_nonexistent%2Ccstring">testproject: c_nonexistent(frmt: cstring): cint</a></li>
</ul></dd>
<dt><a name="c_printf" href="#c_printf"><span>c_printf:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
Expand Down
2 changes: 1 addition & 1 deletion nimdoc/testproject/testproject.nim
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ when true: # procs without `=` (using comment field)
## the c printf.
## etc.

proc c_nonexistant*(frmt: cstring): cint {.importc: "nonexistant", header: "<stdio.h>", varargs, discardable.}
proc c_nonexistent*(frmt: cstring): cint {.importc: "nonexistent", header: "<stdio.h>", varargs, discardable.}

when true: # tests RST inside comments
proc low*[T: Ordinal|enum|range](x: T): T {.magic: "Low", noSideEffect.}
Expand Down
8 changes: 4 additions & 4 deletions tests/generics/t13525.nim
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion tests/importalls/mt6.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/lexer/tcustom_numeric_literals.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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"))"""
Expand Down
4 changes: 2 additions & 2 deletions tests/nimdoc/trunnableexamples.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down
8 changes: 4 additions & 4 deletions tests/stdlib/tos.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/stdlib/tosproc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/stdlib/trstgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion tests/typerel/tvoid.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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())
10 changes: 5 additions & 5 deletions tests/types/titerable.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions tests/vm/tvmops.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

0 comments on commit 78e2d29

Please sign in to comment.