fixed merge conflict

This commit is contained in:
Andreas Rumpf 2018-06-04 16:16:50 +02:00
commit 12996c08a1
30 changed files with 879 additions and 332 deletions

45
tests/array/t7818.nim Normal file
View file

@ -0,0 +1,45 @@
discard """
msg: '''BracketExpr
Sym "array"
Infix
Ident ".."
IntLit 0
IntLit 2
BracketExpr
Sym "Vehicle"
Sym "int"
---------
BracketExpr
Sym "array"
Infix
Ident ".."
IntLit 0
IntLit 2
BracketExpr
Sym "Vehicle"
Sym "int"
---------'''
"""
# bug #7818
# this is not a macro bug, but array construction bug
# I use macro to avoid object slicing
# see #7712 and #7637
import macros
type
Vehicle[T] = object of RootObj
tire: T
Car[T] = object of Vehicle[T]
Bike[T] = object of Vehicle[T]
macro peek(n: typed): untyped =
echo getTypeImpl(n).treeRepr
echo "---------"
var v = Vehicle[int](tire: 3)
var c = Car[int](tire: 4)
var b = Bike[int](tire: 2)
peek([c, b, v])
peek([v, c, b])

8
tests/misc/åäö.nim Normal file
View file

@ -0,0 +1,8 @@
discard """
action: run
"""
# Tests that module names can contain multi byte characters
let a = 1
doAssert åäö.a == 1

View file

@ -10,4 +10,13 @@ proc `$`(o: Obj): string = "foobar"
var o: Obj
doAssert fmt"{o}" == "foobar"
doAssert fmt"{o:10}" == "foobar "
doAssert fmt"{o:10}" == "foobar "
# see issue #7932
doAssert fmt"{15:08}" == "00000015" # int, works
doAssert fmt"{1.5:08}" == "000001.5" # float, works
doAssert fmt"{1.5:0>8}" == "000001.5" # workaround using fill char works for positive floats
doAssert fmt"{-1.5:0>8}" == "0000-1.5" # even that does not work for negative floats
doAssert fmt"{-1.5:08}" == "-00001.5" # works
doAssert fmt"{1.5:+08}" == "+00001.5" # works
doAssert fmt"{1.5: 08}" == " 00001.5" # works

View file

@ -6,6 +6,7 @@ doAssert "@[23, 45]" == $(@[23, 45])
doAssert "[32, 45]" == $([32, 45])
doAssert """@["", "foo", "bar"]""" == $(@["", "foo", "bar"])
doAssert """["", "foo", "bar"]""" == $(["", "foo", "bar"])
doAssert """["", "foo", "bar"]""" == $(@["", "foo", "bar"].toOpenArray(0, 2))
# bug #2395
let alphaSet: set[char] = {'a'..'c'}

View file

@ -79,7 +79,7 @@ proc nimcacheDir(filename, options: string, target: TTarget): string =
proc callCompiler(cmdTemplate, filename, options: string,
target: TTarget, extraOptions=""): TSpec =
let nimcache = nimcacheDir(filename, options, target)
let options = options & " --nimCache:" & nimcache.quoteShell & extraOptions
let options = options & " " & ("--nimCache:" & nimcache).quoteShell & extraOptions
let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target],
"options", options, "file", filename.quoteShell,
"filedir", filename.getFileDir()])