diff options
-rw-r--r-- | lib/pure/strutils.nim | 3 | ||||
-rw-r--r-- | tests/misc/tvarnums.nim | 2 | ||||
-rw-r--r-- | tests/stdlib/nre/captures.nim | 6 | ||||
-rw-r--r-- | tests/stdlib/nre/find.nim | 2 | ||||
-rw-r--r-- | tests/system/toString.nim | 4 | ||||
-rw-r--r-- | tests/vm/trgba.nim | 10 |
6 files changed, 14 insertions, 13 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 18b0954f3..2b87e0d43 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -2434,7 +2434,8 @@ when isMainModule: doAssert formatBiggestFloat(0.00000000001, ffScientific, 1, ',') in ["1,0e-11", "1,0e-011"] # bug #6589 - doAssert formatFloat(123.456, ffScientific, precision=0) == "1.234560e+02" + doAssert formatFloat(123.456, ffScientific, precision=0) in + ["1.234560e+02", "1.234560e+002"] doAssert "$# $3 $# $#" % ["a", "b", "c"] == "a c b c" doAssert "${1}12 ${-1}$2" % ["a", "b"] == "a12 bb" diff --git a/tests/misc/tvarnums.nim b/tests/misc/tvarnums.nim index a5c30c7eb..5daa2c4b8 100644 --- a/tests/misc/tvarnums.nim +++ b/tests/misc/tvarnums.nim @@ -67,7 +67,7 @@ proc toNum64(b: TBuffer): int64 = proc toNum(b: TBuffer): int32 = # treat first byte different: - result = ze(b[0]) and 63 + result = int32 ze(b[0]) and 63 var i = 0 Shift = 6'i32 diff --git a/tests/stdlib/nre/captures.nim b/tests/stdlib/nre/captures.nim index fa01a2000..19c344a8d 100644 --- a/tests/stdlib/nre/captures.nim +++ b/tests/stdlib/nre/captures.nim @@ -32,7 +32,7 @@ suite "captures": test "named capture bounds": let ex1 = "foo".find(re("(?<foo>foo)(?<bar>bar)?")) check(ex1.captureBounds["foo"] == some(0..2)) - check(ex1.captureBounds["bar"] == none(Slice[int, int])) + check(ex1.captureBounds["bar"] == none(Slice[int])) test "capture count": let ex1 = re("(?<foo>foo)(?<bar>bar)?") @@ -42,7 +42,7 @@ suite "captures": test "named capture table": let ex1 = "foo".find(re("(?<foo>foo)(?<bar>bar)?")) check(ex1.captures.toTable == {"foo" : "foo", "bar" : nil}.toTable()) - check(ex1.captureBounds.toTable == {"foo" : some(0..2), "bar" : none(Slice[int, int])}.toTable()) + check(ex1.captureBounds.toTable == {"foo" : some(0..2), "bar" : none(Slice[int])}.toTable()) check(ex1.captures.toTable("") == {"foo" : "foo", "bar" : ""}.toTable()) let ex2 = "foobar".find(re("(?<foo>foo)(?<bar>bar)?")) @@ -51,7 +51,7 @@ suite "captures": test "capture sequence": let ex1 = "foo".find(re("(?<foo>foo)(?<bar>bar)?")) check(ex1.captures.toSeq == @["foo", nil]) - check(ex1.captureBounds.toSeq == @[some(0..2), none(Slice[int, int])]) + check(ex1.captureBounds.toSeq == @[some(0..2), none(Slice[int])]) check(ex1.captures.toSeq("") == @["foo", ""]) let ex2 = "foobar".find(re("(?<foo>foo)(?<bar>bar)?")) diff --git a/tests/stdlib/nre/find.nim b/tests/stdlib/nre/find.nim index c37ac56ba..caa953ff4 100644 --- a/tests/stdlib/nre/find.nim +++ b/tests/stdlib/nre/find.nim @@ -12,7 +12,7 @@ suite "find": test "find bounds": check(toSeq(findIter("1 2 3 4 5 ", re" ")).map( - proc (a: RegexMatch): Slice[int, int] = a.matchBounds + proc (a: RegexMatch): Slice[int] = a.matchBounds ) == @[1..1, 3..3, 5..5, 7..7, 9..9]) test "overlapping find": diff --git a/tests/system/toString.nim b/tests/system/toString.nim index 1279897a7..3e7fc7ddb 100644 --- a/tests/system/toString.nim +++ b/tests/system/toString.nim @@ -3,9 +3,9 @@ discard """ """ doAssert "@[23, 45]" == $(@[23, 45]) -doAssert "[32, 45]" == $([32, 45]) +doAssert "[32, 45]" == $([32, 45]) doAssert "@[, foo, bar]" == $(@["", "foo", "bar"]) -doAssert "[, foo, bar]" == $(["", "foo", "bar"]) +doAssert "[, foo, bar]" == $(["", "foo", "bar"]) # bug #2395 let alphaSet: set[char] = {'a'..'c'} diff --git a/tests/vm/trgba.nim b/tests/vm/trgba.nim index da1a2d0c5..923ea1b2e 100644 --- a/tests/vm/trgba.nim +++ b/tests/vm/trgba.nim @@ -22,14 +22,14 @@ template `B=`*(self: TAggRgba8, val: byte) = template `A=`*(self: TAggRgba8, val: byte) = self[3] = val -proc ABGR* (val: int| int64): TAggRgba8 = +proc ABGR*(val: int| int64): TAggRgba8 = var V = val - result.R = V and 0xFF + result.R = byte(V and 0xFF) V = V shr 8 - result.G = V and 0xFF + result.G = byte(V and 0xFF) V = V shr 8 - result.B = V and 0xFF - result.A = (V shr 8) and 0xFF + result.B = byte(V and 0xFF) + result.A = byte((V shr 8) and 0xFF) const c1 = ABGR(0xFF007F7F) |