tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
This commit is contained in:
parent
ac9c1cd6b9
commit
e80465dacf
372 changed files with 4486 additions and 4486 deletions
|
|
@ -1,31 +1,31 @@
|
|||
# Test the assignment operator for complex types which need RTTI
|
||||
|
||||
type
|
||||
TRec = object
|
||||
x, y: int
|
||||
s: string
|
||||
seq: seq[string]
|
||||
arr: seq[seq[array[0..3, string]]]
|
||||
TRecSeq = seq[TRec]
|
||||
|
||||
proc test() =
|
||||
var
|
||||
a, b: TRec
|
||||
a.x = 1
|
||||
a.y = 2
|
||||
a.s = "Hallo!"
|
||||
a.seq = @["abc", "def", "ghi", "jkl"]
|
||||
a.arr = @[]
|
||||
setLen(a.arr, 4)
|
||||
a.arr[0] = @[]
|
||||
a.arr[1] = @[]
|
||||
|
||||
b = a # perform a deep copy here!
|
||||
b.seq = @["xyz", "huch", "was", "soll"]
|
||||
writeLine(stdout, len(a.seq))
|
||||
writeLine(stdout, a.seq[3])
|
||||
writeLine(stdout, len(b.seq))
|
||||
writeLine(stdout, b.seq[3])
|
||||
writeLine(stdout, b.y)
|
||||
|
||||
test()
|
||||
# Test the assignment operator for complex types which need RTTI
|
||||
|
||||
type
|
||||
TRec = object
|
||||
x, y: int
|
||||
s: string
|
||||
seq: seq[string]
|
||||
arr: seq[seq[array[0..3, string]]]
|
||||
TRecSeq = seq[TRec]
|
||||
|
||||
proc test() =
|
||||
var
|
||||
a, b: TRec
|
||||
a.x = 1
|
||||
a.y = 2
|
||||
a.s = "Hallo!"
|
||||
a.seq = @["abc", "def", "ghi", "jkl"]
|
||||
a.arr = @[]
|
||||
setLen(a.arr, 4)
|
||||
a.arr[0] = @[]
|
||||
a.arr[1] = @[]
|
||||
|
||||
b = a # perform a deep copy here!
|
||||
b.seq = @["xyz", "huch", "was", "soll"]
|
||||
writeLine(stdout, len(a.seq))
|
||||
writeLine(stdout, a.seq[3])
|
||||
writeLine(stdout, len(b.seq))
|
||||
writeLine(stdout, b.seq[3])
|
||||
writeLine(stdout, b.y)
|
||||
|
||||
test()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ type
|
|||
TAny* = object {.pure.}
|
||||
value*: pointer
|
||||
rawType: pointer
|
||||
|
||||
|
||||
proc newAny(value, rawType: pointer): TAny =
|
||||
result.value = value
|
||||
result.rawType = rawType
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ discard """
|
|||
|
||||
var t, s: tuple[x: string, c: int]
|
||||
|
||||
proc ugh: seq[tuple[x: string, c: int]] =
|
||||
proc ugh: seq[tuple[x: string, c: int]] =
|
||||
result = @[("abc", 232)]
|
||||
|
||||
t = ugh()[0]
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ type
|
|||
a, b: int
|
||||
PSomeObj = ref object
|
||||
a, b: int
|
||||
|
||||
|
||||
var a = TSomeObj(a: 8)
|
||||
var b = PSomeObj(a: 5)
|
||||
echo a.a, " ", b.a, " ", a.b, " ", b.b
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue