minor changes to make the test suite green again
This commit is contained in:
parent
57fe3e8c41
commit
1ba31f8df7
3 changed files with 7 additions and 14 deletions
|
|
@ -30,18 +30,13 @@ template colorOp(op: expr) {.immediate.} =
|
|||
extract(b, br, bg, bb)
|
||||
result = rawRGB(op(ar, br), op(ag, bg), op(ab, bb))
|
||||
|
||||
template satPlus(a, b: expr): expr =
|
||||
# saturated plus:
|
||||
block:
|
||||
var result = a +% b
|
||||
if result > 255: result = 255
|
||||
result
|
||||
proc satPlus(a, b: int): int {.inline.} =
|
||||
result = a +% b
|
||||
if result > 255: result = 255
|
||||
|
||||
template satMinus(a, b: expr): expr =
|
||||
block:
|
||||
var result = a -% b
|
||||
if result < 0: result = 0
|
||||
result
|
||||
proc satMinus(a, b: int): int {.inline.} =
|
||||
result = a -% b
|
||||
if result < 0: result = 0
|
||||
|
||||
proc `+`*(a, b: TColor): TColor =
|
||||
## adds two colors: This uses saturated artithmetic, so that each color
|
||||
|
|
|
|||
|
|
@ -1738,7 +1738,6 @@ when isMainModule:
|
|||
else:
|
||||
assert false
|
||||
|
||||
var matches: array[0..5, string]
|
||||
if match("abcdefg", peg"c {d} ef {g}", matches, 2):
|
||||
assert matches[0] == "d"
|
||||
assert matches[1] == "g"
|
||||
|
|
|
|||
|
|
@ -1734,7 +1734,6 @@ when isMainModule:
|
|||
else:
|
||||
doAssert false
|
||||
|
||||
var matches: array[0..5, string]
|
||||
if match("abcdefg", peg"c {d} ef {g}", matches, 2):
|
||||
doAssert matches[0] == "d"
|
||||
doAssert matches[1] == "g"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue