Merge remote-tracking branch 'origin/devel' into fix-test-failures
This commit is contained in:
commit
59d226221b
23 changed files with 110 additions and 30 deletions
22
tests/pragmas/tbitsize.nim
Normal file
22
tests/pragmas/tbitsize.nim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
discard """
|
||||
ccodeCheck: "\\i @'unsigned int flag:1;' .*"
|
||||
"""
|
||||
|
||||
type
|
||||
bits* = object
|
||||
flag* {.bitsize: 1.}: cuint
|
||||
opts* {.bitsize: 4.}: cint
|
||||
|
||||
var
|
||||
b: bits
|
||||
|
||||
assert b.flag == 0
|
||||
b.flag = 1
|
||||
assert b.flag == 1
|
||||
b.flag = 2
|
||||
assert b.flag == 0
|
||||
|
||||
b.opts = 7
|
||||
assert b.opts == 7
|
||||
b.opts = 9
|
||||
assert b.opts == -7
|
||||
9
tests/rational/trat_float.nim
Normal file
9
tests/rational/trat_float.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
discard """
|
||||
file: "trat_float.nim"
|
||||
line: "9,19"
|
||||
errormsg: '''type mismatch: got'''
|
||||
"""
|
||||
import rationals
|
||||
var
|
||||
# this fails - no floats as num or den
|
||||
r = initRational(1.0'f, 1.0'f)
|
||||
10
tests/rational/trat_init.nim
Normal file
10
tests/rational/trat_init.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
discard """
|
||||
file: "trat_init.nim"
|
||||
exitcode: "1"
|
||||
"""
|
||||
import rationals
|
||||
var
|
||||
z = Rational[int](num: 0, den: 1)
|
||||
o = initRational(num=1, den=1)
|
||||
a = initRational(1, 2)
|
||||
r = initRational(1, 0) # this fails - no zero denominator
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#! stdtmpl
|
||||
#? stdtmpl
|
||||
#proc sunsetTemplate*(current, ticker, content: string,
|
||||
# tabs: openarray[array[0..1, string]]): string =
|
||||
# result = ""
|
||||
|
|
|
|||
|
|
@ -213,6 +213,8 @@ proc compilerOutputTests(test: TTest, given: var TSpec, expected: TSpec;
|
|||
expectedmsg = expected.nimout
|
||||
givenmsg = given.nimout.strip
|
||||
nimoutCheck(test, expectedmsg, given)
|
||||
else:
|
||||
givenmsg = given.nimout.strip
|
||||
if given.err == reSuccess: inc(r.passed)
|
||||
r.addResult(test, expectedmsg, givenmsg, given.err)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue