diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-03-04 16:42:13 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-03-04 16:42:13 +0100 |
commit | 1ca2db0273938930f71fb0e85569a1df55b195fb (patch) | |
tree | c89040a351ec52641a1f36d02bf95860442a8489 /tests | |
parent | 32126aaad6db85159bdaa1e71e50a23622fe1452 (diff) | |
parent | b902ea887b7717f658661ae5887602e6e2b61a3a (diff) | |
download | Nim-1ca2db0273938930f71fb0e85569a1df55b195fb.tar.gz |
Merge pull request #2260 from oderwat/upd-deprecated-repeats
Updates to remove deprecated repeatStr() and repeatChar() from all files.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/generics/tgeneric3.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/argument_parser/argument_parser.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim | 6 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/enet_server/enet_server.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/keineschweine.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/lib/map_filter.nim | 4 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/lib/zlib_helpers.nim | 10 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/server/old_sg_server.nim | 2 | ||||
-rw-r--r-- | tests/vm/tconsteval.nim | 2 |
9 files changed, 16 insertions, 16 deletions
diff --git a/tests/generics/tgeneric3.nim b/tests/generics/tgeneric3.nim index 6fb929efb..289bf1fd5 100644 --- a/tests/generics/tgeneric3.nim +++ b/tests/generics/tgeneric3.nim @@ -188,7 +188,7 @@ proc traceTree[T,D](root: PNode[T,D]) = write stdout, space proc doTrace(n: PNode[T,D], level: int) = - var space = repeatChar(2 * level) + var space = spaces(2 * level) traceln(space) write stdout, "node: " if n == nil: diff --git a/tests/manyloc/argument_parser/argument_parser.nim b/tests/manyloc/argument_parser/argument_parser.nim index a507a08e4..060610ae0 100644 --- a/tests/manyloc/argument_parser/argument_parser.nim +++ b/tests/manyloc/argument_parser/argument_parser.nim @@ -471,7 +471,7 @@ proc build_help*(expected: seq[Tparameter_specification] = @[], let width = prefixes.map(proc (x: string): int = 3 + len(x)).max for line in zip(prefixes, helps): - result.add(line.a & repeatChar(width - line.a.len) & line.b) + result.add(line.a & spaces(width - line.a.len) & line.b) proc echo_help*(expected: seq[Tparameter_specification] = @[], diff --git a/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim b/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim index a9759687f..3c5a7835c 100644 --- a/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim +++ b/tests/manyloc/keineschweine/dependencies/genpacket/streams_enh.nim @@ -1,5 +1,5 @@ import streams -from strutils import repeatChar +from strutils import repeat proc readPaddedStr*(s: PStream, length: int, padChar = '\0'): TaintedString = var lastChr = length @@ -10,7 +10,7 @@ proc readPaddedStr*(s: PStream, length: int, padChar = '\0'): TaintedString = proc writePaddedStr*(s: PStream, str: string, length: int, padChar = '\0') = if str.len < length: s.write(str) - s.write(repeatChar(length - str.len, padChar)) + s.write(repeat(padChar, length - str.len)) elif str.len > length: s.write(str.substr(0, length - 1)) else: @@ -37,7 +37,7 @@ when isMainModule: testStream.setPosition 0 testStream.writePaddedStr("Sup", 10) echo(repr(testStream), testStream.data.len) - doAssert testStream.data == "Sup"&repeatChar(7, '\0') + doAssert testStream.data == "Sup"&repeat('\0', 7) testStream.setPosition 0 res = testStream.readPaddedStr(10) diff --git a/tests/manyloc/keineschweine/enet_server/enet_server.nim b/tests/manyloc/keineschweine/enet_server/enet_server.nim index 6dd1a6a7f..c2e893273 100644 --- a/tests/manyloc/keineschweine/enet_server/enet_server.nim +++ b/tests/manyloc/keineschweine/enet_server/enet_server.nim @@ -144,7 +144,7 @@ when isMainModule: discard """block: var TestFile: FileChallengePair - contents = repeatStr(2, "abcdefghijklmnopqrstuvwxyz") + contents = repeat("abcdefghijklmnopqrstuvwxyz", 2) testFile.challenge = newScFileChallenge("foobar.test", FZoneCfg, contents.len.int32) testFile.file = checksumStr(contents) myAssets.add testFile""" diff --git a/tests/manyloc/keineschweine/keineschweine.nim b/tests/manyloc/keineschweine/keineschweine.nim index 0a5dc1efc..525d8a054 100644 --- a/tests/manyloc/keineschweine/keineschweine.nim +++ b/tests/manyloc/keineschweine/keineschweine.nim @@ -113,7 +113,7 @@ when defined(recordMode): isRecording = false proc zeroPad*(s: string; minLen: int): string = if s.len < minLen: - result = repeatChar(minLen - s.len, '0') + result = repeat(0, minLen - s.len) result.add s else: result = s diff --git a/tests/manyloc/keineschweine/lib/map_filter.nim b/tests/manyloc/keineschweine/lib/map_filter.nim index 966b84b6a..5776c9225 100644 --- a/tests/manyloc/keineschweine/lib/map_filter.nim +++ b/tests/manyloc/keineschweine/lib/map_filter.nim @@ -27,9 +27,9 @@ when isMainModule: var res = t.map(proc(z: int): int = result = z * 10) dumpSeq res - from strutils import toHex, repeatStr + from strutils import toHex var foocakes = t.map(proc(z: int): string = - result = toHex((z * 23).biggestInt, 4)) + result = toHex((z * 23).BiggestInt, 4)) dumpSeq foocakes t.mapInPlace(proc(z: int): int = result = z * 30) diff --git a/tests/manyloc/keineschweine/lib/zlib_helpers.nim b/tests/manyloc/keineschweine/lib/zlib_helpers.nim index 9a6542d75..fcd0e8d24 100644 --- a/tests/manyloc/keineschweine/lib/zlib_helpers.nim +++ b/tests/manyloc/keineschweine/lib/zlib_helpers.nim @@ -24,17 +24,17 @@ when isMainModule: import strutils var r = compress("Hello") echo repr(r) - var l = "Hello".len - var rr = uncompress(r, l) + var ln = "Hello".len + var rr = uncompress(r, ln) echo repr(rr) assert rr == "Hello" - proc `*`(a: string; b: int): string {.inline.} = result = repeatStr(b, a) + proc `*`(a: string; b: int): string {.inline.} = result = repeat(a, b) var s = "yo dude sup bruh homie" * 50 r = compress(s) echo s.len, " -> ", r.len - l = s.len - rr = uncompress(r, l) + ln = s.len + rr = uncompress(r, ln) echo r.len, " -> ", rr.len assert rr == s \ No newline at end of file diff --git a/tests/manyloc/keineschweine/server/old_sg_server.nim b/tests/manyloc/keineschweine/server/old_sg_server.nim index ac85cbf62..1e57c12a1 100644 --- a/tests/manyloc/keineschweine/server/old_sg_server.nim +++ b/tests/manyloc/keineschweine/server/old_sg_server.nim @@ -174,7 +174,7 @@ when isMainModule: block: var TestFile: FileChallengePair - contents = repeatStr(2, "abcdefghijklmnopqrstuvwxyz") + contents = repeat("abcdefghijklmnopqrstuvwxyz", 2) testFile.challenge = newScFileChallenge("foobar.test", FZoneCfg, contents.len.int32) testFile.file = checksumStr(contents) myAssets.add testFile diff --git a/tests/vm/tconsteval.nim b/tests/vm/tconsteval.nim index 96a1bafe8..4459931c5 100644 --- a/tests/vm/tconsteval.nim +++ b/tests/vm/tconsteval.nim @@ -24,7 +24,7 @@ Possible Commands: csource [options] builds the C sources for installation zip builds the installation ZIP package inno builds the Inno Setup installer -""" % [NimVersion & repeatChar(44-len(NimVersion)), +""" % [NimVersion & spaces(44-len(NimVersion)), CompileDate, CompileTime] echo HelpText |