make tests green again

This commit is contained in:
Andreas Rumpf 2017-10-16 20:29:16 +02:00
commit 9485f1c888
4 changed files with 14 additions and 9 deletions

View file

@ -10,3 +10,5 @@
in ``system.nim`` and do the right thing. in ``system.nim`` and do the right thing.
- JSON: Deprecated `getBVal`, `getFNum`, and `getNum` in favour to - JSON: Deprecated `getBVal`, `getFNum`, and `getNum` in favour to
`getBool`, `getFloat`, `getBiggestInt`. Also `getInt` procedure was added. `getBool`, `getFloat`, `getBiggestInt`. Also `getInt` procedure was added.
- ``echo`` now works with strings that contain ``\0`` (the binary zero is not
shown) and ``nil`` strings are equal to empty strings.

View file

@ -977,6 +977,9 @@ proc genEcho(p: BProc, n: PNode) =
addf(args, ", $1? ($1)->data:\"nil\"", [rdLoc(a)]) addf(args, ", $1? ($1)->data:\"nil\"", [rdLoc(a)])
p.module.includeHeader("<base/log.h>") p.module.includeHeader("<base/log.h>")
linefmt(p, cpsStmts, """Genode::log(""$1);$n""", args) linefmt(p, cpsStmts, """Genode::log(""$1);$n""", args)
else:
if n.len == 0:
linefmt(p, cpsStmts, "#echoBinSafe(NIM_NIL, $1);$n", n.len.rope)
else: else:
var a: TLoc var a: TLoc
initLocExpr(p, n, a) initLocExpr(p, n, a)

View file

@ -1,7 +1,7 @@
discard """ discard """
output: '''nil output: '''
nil
nil''' '''
""" """
type Bar = object type Bar = object

View file

@ -1,7 +1,7 @@
discard """ discard """
output: '''10 output: '''10
10 10
nil
1''' 1'''
msg: ''' msg: '''
K=string V=int K=string V=int