diff options
author | Juan Carlos <juancarlospaco@gmail.com> | 2021-01-15 23:56:38 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 18:56:38 -0800 |
commit | 78a99587a4ad8ad17a179a7992fcda8a6e10f25a (patch) | |
tree | 18a244e09f7db4636b3bd221130f36f5d5fb8b97 /tests/stdlib | |
parent | 7b632f9ccbd4d15fa9fe4ca45b6fea22b259c81d (diff) | |
download | Nim-78a99587a4ad8ad17a179a7992fcda8a6e10f25a.tar.gz |
Deprecate TaintedString (#15423)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/tmemlinesBuf.nim | 2 | ||||
-rw-r--r-- | tests/stdlib/tosproc.nim | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/stdlib/tmemlinesBuf.nim b/tests/stdlib/tmemlinesBuf.nim index 97ad751ee..ea607525d 100644 --- a/tests/stdlib/tmemlinesBuf.nim +++ b/tests/stdlib/tmemlinesBuf.nim @@ -5,7 +5,7 @@ disabled: "appveyor" import memfiles var inp = memfiles.open("tests/stdlib/tmemlinesBuf.nim") -var buffer: TaintedString = "" +var buffer: string = "" var lineCount = 0 for line in lines(inp, buffer): lineCount += 1 diff --git a/tests/stdlib/tosproc.nim b/tests/stdlib/tosproc.nim index ab8024746..96cff1468 100644 --- a/tests/stdlib/tosproc.nim +++ b/tests/stdlib/tosproc.nim @@ -195,15 +195,15 @@ else: # main driver # bugfix: windows stdin.close was a noop and led to blocking reads proc startProcessTest(command: string, options: set[ProcessOption] = { poStdErrToStdOut, poUsePath}, input = ""): tuple[ - output: TaintedString, + output: string, exitCode: int] {.tags: [ExecIOEffect, ReadIOEffect, RootEffect], gcsafe.} = var p = startProcess(command, options = options + {poEvalCommand}) var outp = outputStream(p) if input.len > 0: inputStream(p).write(input) close inputStream(p) - result = (TaintedString"", -1) - var line = newStringOfCap(120).TaintedString + result = ("", -1) + var line = newStringOfCap(120) while true: if outp.readLine(line): result[0].string.add(line.string) @@ -223,7 +223,7 @@ else: # main driver p.inputStream.flush() var line = "" var s: seq[string] - while p.outputStream.readLine(line.TaintedString): + while p.outputStream.readLine(line): s.add line doAssert s == @["10"] @@ -235,15 +235,15 @@ else: # main driver deferScoped: p.close() do: var sout: seq[string] - while p.outputStream.readLine(x.TaintedString): sout.add x + while p.outputStream.readLine(x): sout.add x doAssert sout == @["start ta_out", "to stdout", "to stdout", "to stderr", "to stderr", "to stdout", "to stdout", "end ta_out"] block: # startProcess stderr (replaces old test `tstderr` + `ta_out`) var p = startProcess(output, dir, options={}) deferScoped: p.close() do: var serr, sout: seq[string] - while p.errorStream.readLine(x.TaintedString): serr.add x - while p.outputStream.readLine(x.TaintedString): sout.add x + while p.errorStream.readLine(x): serr.add x + while p.outputStream.readLine(x): sout.add x doAssert serr == @["to stderr", "to stderr"] doAssert sout == @["start ta_out", "to stdout", "to stdout", "to stdout", "to stdout", "end ta_out"] |