diff options
Diffstat (limited to 'tests')
31 files changed, 56 insertions, 139 deletions
diff --git a/tests/async/twinasyncrw.nim b/tests/async/twinasyncrw.nim index 6763eb5a2..db10fffce 100644 --- a/tests/async/twinasyncrw.nim +++ b/tests/async/twinasyncrw.nim @@ -203,11 +203,11 @@ when defined(windows): add(result, c) proc sendMessages(client: AsyncFD) {.async.} = - for i in 0 .. <messagesToSend: + for i in 0 ..< messagesToSend: await winSend(client, "Message " & $i & "\c\L") proc launchSwarm(port: Port) {.async.} = - for i in 0 .. <swarmSize: + for i in 0 ..< swarmSize: var sock = newNativeSocket() setBlocking(sock, false) diff --git a/tests/ccgbugs/taddhigh.nim b/tests/ccgbugs/taddhigh.nim index 549eb8caa..6b0658612 100644 --- a/tests/ccgbugs/taddhigh.nim +++ b/tests/ccgbugs/taddhigh.nim @@ -14,6 +14,6 @@ s.add x s.add s[s.high] s.add s[s.len-1] -s.add s[s.xlen-1] +s.add s[s.len-1] echo s # @[5, 5, 0] diff --git a/tests/concepts/matrixalgo.nim b/tests/concepts/matrixalgo.nim index 39cf16685..98e5b8b4f 100644 --- a/tests/concepts/matrixalgo.nim +++ b/tests/concepts/matrixalgo.nim @@ -16,8 +16,8 @@ type AnyTransform3D* = AnyMatrix[4, 4, float] proc transposed*(m: AnyMatrix): m.TransposedType = - for r in 0 .. <m.R: - for c in 0 .. <m.C: + for r in 0 ..< m.R: + for c in 0 ..< m.C: result[r, c] = m[c, r] proc determinant*(m: AnySquareMatrix): int = diff --git a/tests/concepts/t3330.nim b/tests/concepts/t3330.nim index ab77dd347..067e81133 100644 --- a/tests/concepts/t3330.nim +++ b/tests/concepts/t3330.nim @@ -9,33 +9,33 @@ proc test(foo: Foo[int]) required type for foo: Foo[int] but expression 'bar' is of type: Bar[system.int] t3330.nim(63, 8) Hint: Non-matching candidates for add(k, string, T) -proc add[T](x: var seq[T]; y: T) - first type mismatch at position: 1 - required type for x: var seq[T] - but expression 'k' is of type: Alias proc add(x: var string; y: string) first type mismatch at position: 1 required type for x: var string but expression 'k' is of type: Alias +proc add[T](x: var seq[T]; y: openArray[T]) + first type mismatch at position: 1 + required type for x: var seq[T] + but expression 'k' is of type: Alias proc add(result: var string; x: float) first type mismatch at position: 1 required type for result: var string but expression 'k' is of type: Alias -proc add(x: var string; y: char) +proc add[T](x: var seq[T]; y: T) first type mismatch at position: 1 - required type for x: var string + required type for x: var seq[T] but expression 'k' is of type: Alias proc add(x: var string; y: cstring) first type mismatch at position: 1 required type for x: var string but expression 'k' is of type: Alias -proc add(result: var string; x: int64) +proc add(x: var string; y: char) first type mismatch at position: 1 - required type for result: var string + required type for x: var string but expression 'k' is of type: Alias -proc add[T](x: var seq[T]; y: openArray[T]) +proc add(result: var string; x: int64) first type mismatch at position: 1 - required type for x: var seq[T] + required type for result: var string but expression 'k' is of type: Alias t3330.nim(63, 8) template/generic instantiation of `add` from here diff --git a/tests/deps/opengl-1.1.0/opengl.nim b/tests/deps/opengl-1.1.0/opengl.nim index bea0c58ca..55e009a46 100644 --- a/tests/deps/opengl-1.1.0/opengl.nim +++ b/tests/deps/opengl-1.1.0/opengl.nim @@ -410,7 +410,7 @@ macro wrapErrorChecking(f: stmt): stmt {.immediate.} = body = newStmtList glProc returnsSomething = child.params[0].kind != nnkEmpty callParams = newSeq[when defined(nimnode): NimNode else: PNimrodNode]() - for param in params[1 .. <params.len]: + for param in params[1 ..< params.len]: callParams.add param[0] let glCall = newCall(glProc.name, callParams) diff --git a/tests/destructor/tnewruntime_strutils.nim b/tests/destructor/tnewruntime_strutils.nim index dd190a1b6..54ce4acea 100644 --- a/tests/destructor/tnewruntime_strutils.nim +++ b/tests/destructor/tnewruntime_strutils.nim @@ -1,9 +1,9 @@ discard """ cmd: '''nim c --newruntime $file''' - output: '''443 443''' + output: '''422 422''' """ -import strutils, os +import strutils, os, std / wordwrap import core / allocators import system / ansi_c @@ -76,12 +76,12 @@ proc staticTests = inp = """ this is a long text -- muchlongerthan10chars and here it goes""" outp = " this is a\nlong text\n--\nmuchlongerthan10chars\nand here\nit goes" - doAssert wordWrap(inp, 10, false) == outp + doAssert wrapWords(inp, 10, false) == outp let longInp = """ThisIsOneVeryLongStringWhichWeWillSplitIntoEightSeparatePartsNow""" longOutp = "ThisIsOn\neVeryLon\ngStringW\nhichWeWi\nllSplitI\nntoEight\nSeparate\nPartsNow" - doAssert wordWrap(longInp, 8, true) == longOutp + doAssert wrapWords(longInp, 8, true) == longOutp doAssert "$animal eats $food." % ["animal", "The cat", "food", "fish"] == "The cat eats fish." diff --git a/tests/gc/closureleak.nim b/tests/gc/closureleak.nim index d2ecc0b54..f86a936d8 100644 --- a/tests/gc/closureleak.nim +++ b/tests/gc/closureleak.nim @@ -22,10 +22,10 @@ proc newFoo*(): ref TFoo = alive_foos.add result.id inc foo_counter -for i in 0 .. <10: +for i in 0 ..< 10: discard newFoo() -for i in 0 .. <10: +for i in 0 ..< 10: let f = newFoo() f.fn = proc = echo f.id diff --git a/tests/iter/titer10.nim b/tests/iter/titer10.nim index 9c76b62e1..ae36aa519 100644 --- a/tests/iter/titer10.nim +++ b/tests/iter/titer10.nim @@ -40,7 +40,7 @@ when true: @[2, 3]] iterator threadUniqs(seq1: seq[seq[int]]): seq[seq[int]] = - for i in 0 .. <seq1.len: + for i in 0 ..< seq1.len: block: let i = i yield seq1.filter do (x: seq[int]) -> bool: x[0] == seq1[i][0] diff --git a/tests/macros/tmacrogensym.nim b/tests/macros/tmacrogensym.nim index 1237b8bf7..15a08c574 100644 --- a/tests/macros/tmacrogensym.nim +++ b/tests/macros/tmacrogensym.nim @@ -8,7 +8,7 @@ proc convertReturns(node, retFutureSym: NimNode): NimNode {.compileTime.} = result = newCall(newIdentNode("complete"), retFutureSym, node[0]) else: result = node - for i in 0 .. <node.len: + for i in 0 ..< node.len: result[i] = convertReturns(node[i], retFutureSym) macro async2(prc: untyped): untyped = @@ -51,7 +51,7 @@ macro async2(prc: untyped): untyped = result = prc # Remove the 'closure' pragma. - for i in 0 .. <result[4].len: + for i in 0 ..< result[4].len: if result[4][i].ident == !"async": result[4].del(i) diff --git a/tests/manyloc/keineschweine/enet_server/enet_client.nim b/tests/manyloc/keineschweine/enet_server/enet_client.nim index 7b8576a14..7aa7b9c2f 100644 --- a/tests/manyloc/keineschweine/enet_server/enet_client.nim +++ b/tests/manyloc/keineschweine/enet_server/enet_client.nim @@ -197,7 +197,7 @@ proc lobbyInit*() = messageArea.scrollBack -= 1 update(messageArea)) gui.newButton(text = "Flood msg area", position = vec2f(185, 30), onClick = proc(b: PButton) = - for i in 0.. <30: + for i in 0..< 30: dispMessage($i))""" dirServer = newServer() dirServer.addHandler HChat, handleChat diff --git a/tests/manyloc/keineschweine/server/sg_lobby.nim b/tests/manyloc/keineschweine/server/sg_lobby.nim index d83f35726..d7e01e6e6 100644 --- a/tests/manyloc/keineschweine/server/sg_lobby.nim +++ b/tests/manyloc/keineschweine/server/sg_lobby.nim @@ -243,7 +243,7 @@ proc lobbyInit*() = messageArea.scrollBack -= 1 update(messageArea)) gui.newButton(text = "Flood msg area", position = vec2f(185, 30), onClick = proc(b: PButton) = - for i in 0.. <30: + for i in 0..< 30: dispMessage($i)) var i = 0 diff --git a/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim b/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim index 8c26c04eb..3bfaf1cbc 100644 --- a/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim +++ b/tests/manyloc/named_argument_bug/tri_engine/gfx/gl/primitive.nim @@ -61,7 +61,7 @@ proc newPrimitive*(verts: var seq[TVert], color=white(), z: TZ_range=0): PPrimitive = var indices = newSeq[GLushort](verts.len) - for i in 0 .. <verts.len: + for i in 0 ..< verts.len: indices[i] = i.GLushort new(result) @@ -108,7 +108,7 @@ proc updVerts*(o: PPrimitive, start, `end`: int, f: proc(i: int, vert: var TVert cast[GLvoid](cast[int](o.verts[0].addr) + byteOffset)) proc updAllVerts(o: PPrimitive, f: proc(i: int, vert: var TVert)) = - for i in 0 .. <o.verts.len: + for i in 0 ..< o.verts.len: f(i, o.verts[i]) ?glBindBuffer(GLarrayBuffer, o.arrBufId) @@ -132,7 +132,7 @@ proc newVertCircle*(circle: TCircle, nSegs: Natural=0): seq[TVert] = result = newSeq[TVert](nSegs) #result[0] = newVert(circle.p, newV2xy(0.5)) - for i in 1 .. <nSegs: + for i in 1 ..< nSegs: let pos = newV2(x + circle.p.x, y + circle.p.y) let texCoord = pos * newV2xy(1.0 / circle.r) diff --git a/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim b/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim index 926958fe4..18ede6100 100644 --- a/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim +++ b/tests/manyloc/named_argument_bug/tri_engine/math/vec.nim @@ -14,7 +14,7 @@ type # TODO: Change to TVT when compiler issue is resolved. proc `$`*[T](o: TV2[T]): string = result = "(" - for i in 0 .. <o.len: + for i in 0 ..< o.len: result &= $o[0] if i != o.len - 1: result &= ", " @@ -47,7 +47,7 @@ proc `+`*(lhs: TV2[TR], rhs: TV2[TR]): TV2[TR] = # result += a[i] * b[i] proc dot[T](a, b: TV2[T]): T = - for i in 0 .. <a.len: + for i in 0 ..< a.len: result += a[i] * b[i] assert dot(newV2(), newV2()) == 0.0 diff --git a/tests/metatype/tstaticvector.nim b/tests/metatype/tstaticvector.nim index 1a7bdeafe..ca16518fe 100644 --- a/tests/metatype/tstaticvector.nim +++ b/tests/metatype/tstaticvector.nim @@ -61,7 +61,7 @@ proc row*(a: TMatrix; i: int): auto = proc col*(a: TMatrix; j: int): auto = result = TVec[TMatrix.N, TMatrix.T]() - for idx in 0 .. <TMatrix.N: + for idx in 0 ..< TMatrix.N: result.data[idx] = a.data[(TMatrix.N * (idx)) + (j-1)] proc mul*(a: TMat4f; b: TMat4f): TMat4f = diff --git a/tests/misc/tsortdev.nim b/tests/misc/tsortdev.nim index 0b2a4f3e8..6a290577b 100644 --- a/tests/misc/tsortdev.nim +++ b/tests/misc/tsortdev.nim @@ -39,7 +39,7 @@ proc cmpPlatforms(a, b: string): int = proc sorted[T](a: openArray[T]): bool = result = true - for i in 0 .. < a.high: + for i in 0 ..< a.high: if cmpPlatforms(a[i], a[i+1]) > 0: echo "Out of order: ", a[i], " ", a[i+1] result = false diff --git a/tests/misc/tstrange.nim b/tests/misc/tstrange.nim index 82a82d267..f8c063240 100644 --- a/tests/misc/tstrange.nim +++ b/tests/misc/tstrange.nim @@ -24,5 +24,5 @@ write(stdout, ack(5, 4)) # bug #1442 let h=3 -for x in 0.. <h.int: +for x in 0 ..< h.int: echo x diff --git a/tests/niminaction/Chapter1/various1.nim b/tests/niminaction/Chapter1/various1.nim index 688180fd2..4e2cb463d 100644 --- a/tests/niminaction/Chapter1/various1.nim +++ b/tests/niminaction/Chapter1/various1.nim @@ -19,7 +19,7 @@ proc showNumber(num: int | float) = showNumber(3.14) showNumber(42) -for i in 0 .. <10: +for i in 0 ..< 10: echo(i) block: # Block added due to clash. diff --git a/tests/niminaction/Chapter2/various2.nim b/tests/niminaction/Chapter2/various2.nim index 3f6a3f453..dddbdb472 100644 --- a/tests/niminaction/Chapter2/various2.nim +++ b/tests/niminaction/Chapter2/various2.nim @@ -202,7 +202,7 @@ block: block: let list = @[4, 8, 15, 16, 23, 42] - for i in 0 .. <list.len: + for i in 0 ..< list.len: stdout.write($list[i] & " ") var collection: set[int16] @@ -366,4 +366,4 @@ block: Color {.pure.} = enum red, green, blue - let color = Color.red \ No newline at end of file + let color = Color.red diff --git a/tests/niminaction/Chapter3/various3.nim b/tests/niminaction/Chapter3/various3.nim index 7b2776d70..711740da8 100644 --- a/tests/niminaction/Chapter3/various3.nim +++ b/tests/niminaction/Chapter3/various3.nim @@ -46,7 +46,7 @@ assert obj["username"].str == "Dominik" block: proc count10(): int = - for i in 0 .. <10: + for i in 0 ..< 10: result.inc assert count10() == 10 diff --git a/tests/niminaction/Chapter6/WikipediaStats/concurrency.nim b/tests/niminaction/Chapter6/WikipediaStats/concurrency.nim index 766f07fa5..913cd77db 100644 --- a/tests/niminaction/Chapter6/WikipediaStats/concurrency.nim +++ b/tests/niminaction/Chapter6/WikipediaStats/concurrency.nim @@ -67,9 +67,9 @@ proc readChunks(filename: string, chunksize = 1000000): Stats = # Find where the last line ends chunkLen.dec - responses.add(spawn parse(buffer[0 .. <chunkLen])) + responses.add(spawn parse(buffer[0 ..< chunkLen])) oldBufferLen = readSize - chunkLen - buffer[0 .. <oldBufferLen] = buffer[readSize - oldBufferLen .. ^1] + buffer[0 ..< oldBufferLen] = buffer[readSize - oldBufferLen .. ^1] for resp in responses: let statistic = ^resp diff --git a/tests/niminaction/Chapter6/WikipediaStats/concurrency_regex.nim b/tests/niminaction/Chapter6/WikipediaStats/concurrency_regex.nim index 19b157926..102313de9 100644 --- a/tests/niminaction/Chapter6/WikipediaStats/concurrency_regex.nim +++ b/tests/niminaction/Chapter6/WikipediaStats/concurrency_regex.nim @@ -51,9 +51,9 @@ proc readChunks(filename: string, chunksize = 1000000): Stats = # Find where the last line ends chunkLen.dec - responses.add(spawn parse(buffer[0 .. <chunkLen])) + responses.add(spawn parse(buffer[0 ..< chunkLen])) oldBufferLen = readSize - chunkLen - buffer[0 .. <oldBufferLen] = buffer[readSize - oldBufferLen .. ^1] + buffer[0 ..< oldBufferLen] = buffer[readSize - oldBufferLen .. ^1] echo("Spawns: ", responses.len) for resp in responses: diff --git a/tests/niminaction/Chapter6/WikipediaStats/parallel_counts.nim b/tests/niminaction/Chapter6/WikipediaStats/parallel_counts.nim index 2c4a59d83..379ec7364 100644 --- a/tests/niminaction/Chapter6/WikipediaStats/parallel_counts.nim +++ b/tests/niminaction/Chapter6/WikipediaStats/parallel_counts.nim @@ -58,9 +58,9 @@ proc readPageCounts(filename: string, chunkSize = 1_000_000) = while chunkLen >= 0 and buffer[chunkLen - 1] notin NewLines: chunkLen.dec - responses.add(spawn parseChunk(buffer[0 .. <chunkLen])) + responses.add(spawn parseChunk(buffer[0 ..< chunkLen])) oldBufferLen = readSize - chunkLen - buffer[0 .. <oldBufferLen] = buffer[readSize - oldBufferLen .. ^1] + buffer[0 ..< oldBufferLen] = buffer[readSize - oldBufferLen .. ^1] var mostPopular = newStats() for resp in responses: diff --git a/tests/niminaction/Chapter6/WikipediaStats/race_condition.nim b/tests/niminaction/Chapter6/WikipediaStats/race_condition.nim index db68aeb5c..f4b072204 100644 --- a/tests/niminaction/Chapter6/WikipediaStats/race_condition.nim +++ b/tests/niminaction/Chapter6/WikipediaStats/race_condition.nim @@ -7,7 +7,7 @@ import threadpool var counter = 0 proc increment(x: int) = - for i in 0 .. <x: + for i in 0 ..< x: let value = counter + 1 counter = value diff --git a/tests/niminaction/Chapter6/WikipediaStats/unguarded_access.nim b/tests/niminaction/Chapter6/WikipediaStats/unguarded_access.nim index 502ea61a9..7bdde8397 100644 --- a/tests/niminaction/Chapter6/WikipediaStats/unguarded_access.nim +++ b/tests/niminaction/Chapter6/WikipediaStats/unguarded_access.nim @@ -10,7 +10,7 @@ initLock(counterLock) var counter {.guard: counterLock.} = 0 proc increment(x: int) = - for i in 0 .. <x: + for i in 0 ..< x: let value = counter + 1 counter = value diff --git a/tests/niminaction/Chapter7/Tweeter/src/database.nim b/tests/niminaction/Chapter7/Tweeter/src/database.nim index 4faba3f6a..3785ea307 100644 --- a/tests/niminaction/Chapter7/Tweeter/src/database.nim +++ b/tests/niminaction/Chapter7/Tweeter/src/database.nim @@ -79,9 +79,9 @@ proc findMessages*(database: Database, usernames: seq[string], result = @[] if usernames.len == 0: return var whereClause = " WHERE " - for i in 0 .. <usernames.len: + for i in 0 ..< usernames.len: whereClause.add("username = ? ") - if i != <usernames.len: + if i != usernames.high: whereClause.add("or ") let messages = database.db.getAllRows( diff --git a/tests/parallel/tmissing_deepcopy.nim b/tests/parallel/tmissing_deepcopy.nim index 694eb77db..94e027b60 100644 --- a/tests/parallel/tmissing_deepcopy.nim +++ b/tests/parallel/tmissing_deepcopy.nim @@ -26,9 +26,9 @@ proc greet(p:Person) = " friend:", p.friend.name, "(", cast[int](addr p.friend.name),") }" proc setup = - for i in 0 .. <20: + for i in 0 ..< 20: people.add newPerson("Person" & $(i + 1)) - for i in 0 .. <20: + for i in 0 ..< 20: people[i].friend = people[19-i] proc update = diff --git a/tests/parallel/tsimple_array_checks.nim b/tests/parallel/tsimple_array_checks.nim index 5d6e87efe..650b809e0 100644 --- a/tests/parallel/tsimple_array_checks.nim +++ b/tests/parallel/tsimple_array_checks.nim @@ -35,9 +35,9 @@ proc main = parallel: for n in nums: # Error: cannot prove: i <= len(nums) + -1 spawn log(n) - #for i in 0 .. <nums.len: # Error: cannot prove: i <= len(nums) + -1 + #for i in 0 ..< nums.len: # Error: cannot prove: i <= len(nums) + -1 #for i in 0 .. nums.len-1: # WORKS! - #for i in 0 .. <nums.len: # WORKS! + #for i in 0 ..< nums.len: # WORKS! # spawn log(nums[i]) # Array needs explicit size to work, probably related to issue #2287 diff --git a/tests/parallel/twrong_refcounts.nim b/tests/parallel/twrong_refcounts.nim deleted file mode 100644 index ed3c1b894..000000000 --- a/tests/parallel/twrong_refcounts.nim +++ /dev/null @@ -1,56 +0,0 @@ -discard """ - output: "Success" - target: "c" -""" - -# Note: target: "cpp" fails because we can't yet have `extern "C"` mangling in -# `exportc` procs. -import math, random, threadPool - -# --- - -type - Person = object - age: int - friend: ref Person - -var - people: seq[ref Person] = @[] - -proc newPerson(age:int): ref Person = - result.new() - result.age = age - -proc greet(p:Person) = - #echo p.age, ", ", p.friend.age - p.friend.age += 1 - -# --- - -proc setup = - for i in 0 .. <20: - people.add newPerson(i + 1) - for i in 0 .. <20: - people[i].friend = people[random(20)] - -proc update = - var countA: array[20, int] - var countB: array[20, int] - - for i, p in people: - countA[i] = getRefCount(p) - parallel: - for i in 0 .. people.high: - spawn greet(people[i][]) - for i, p in people: - countB[i] = getRefCount(p) - - for i in 0 .. <20: - doAssert countA[i] == countB[i] - echo "Success" - -# --- - -when true: - setup() - update() diff --git a/tests/showoff/tdrdobbs_examples.nim b/tests/showoff/tdrdobbs_examples.nim index 8687ee529..0e10c6dd8 100644 --- a/tests/showoff/tdrdobbs_examples.nim +++ b/tests/showoff/tdrdobbs_examples.nim @@ -47,7 +47,7 @@ proc filter[T](a: openarray[T], predicate: proc (x: T): bool): seq[T] = proc map[T, S](a: openarray[T], fn: proc (x: T): S): seq[S] = newSeq(result, a.len) - for i in 0 .. <a.len: result[i] = fn(a[i]) + for i in 0 ..< a.len: result[i] = fn(a[i]) type diff --git a/tests/statictypes/tpassthruarith.nim b/tests/statictypes/tpassthruarith.nim index 90fc7824c..857e5b0af 100644 --- a/tests/statictypes/tpassthruarith.nim +++ b/tests/statictypes/tpassthruarith.nim @@ -46,7 +46,7 @@ type Vect[N: static[int], A] = array[N, A] proc push[N: static[int], A](a: Vect[N, A], x: A): Vect[N + 1, A] = - for n in 0 .. < N: + for n in 0 ..< N: result[n] = a[n] result[N] = x diff --git a/tests/stdlib/tstrutil.nim b/tests/stdlib/tstrutil.nim index 304c2c325..0ad0cbd46 100644 --- a/tests/stdlib/tstrutil.nim +++ b/tests/stdlib/tstrutil.nim @@ -155,24 +155,6 @@ proc testDelete = delete(s, 0, 0) assert s == "1236789ABCDEFG" -proc testIsAlphaNumeric = - assert isAlphaNumeric("abcdABC1234") == true - assert isAlphaNumeric("a") == true - assert isAlphaNumeric("abcABC?1234") == false - assert isAlphaNumeric("abcABC 1234") == false - assert isAlphaNumeric(".") == false - -testIsAlphaNumeric() - -proc testIsDigit = - assert isDigit("1") == true - assert isDigit("1234") == true - assert isDigit("abcABC?1234") == false - assert isDigit(".") == false - assert isDigit(":") == false - -testIsDigit() - proc testFind = assert "0123456789ABCDEFGH".find('A') == 10 assert "0123456789ABCDEFGH".find('A', 5) == 10 @@ -273,15 +255,6 @@ assert(insertSep($232) == "232") assert(insertSep($12345, ',') == "12,345") assert(insertSep($0) == "0") -assert(editDistance("prefix__hallo_suffix", "prefix__hallo_suffix") == 0) -assert(editDistance("prefix__hallo_suffix", "prefix__hallo_suffi1") == 1) -assert(editDistance("prefix__hallo_suffix", "prefix__HALLO_suffix") == 5) -assert(editDistance("prefix__hallo_suffix", "prefix__ha_suffix") == 3) -assert(editDistance("prefix__hallo_suffix", "prefix") == 14) -assert(editDistance("prefix__hallo_suffix", "suffix") == 14) -assert(editDistance("prefix__hallo_suffix", "prefix__hao_suffix") == 2) -assert(editDistance("main", "malign") == 2) - assert "/1/2/3".rfind('/') == 4 assert "/1/2/3".rfind('/', last=1) == 0 assert "/1/2/3".rfind('0') == -1 @@ -307,7 +280,7 @@ assert "".toHex == "" assert "\x00\xFF\x80".toHex == "00FF80" assert "0123456789abcdef".parseHexStr.toHex == "0123456789ABCDEF" -assert(' '.repeat(8)== " ") +assert(' '.repeat(8) == " ") assert(" ".repeat(8) == " ") assert(spaces(8) == " ") |