mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
This commit is contained in:
@@ -5,10 +5,10 @@ type
|
||||
a: int
|
||||
TB = object of TA
|
||||
b: array[0..5000_000, int]
|
||||
|
||||
|
||||
proc ap(x: var TA) = x.a = -1
|
||||
proc bp(x: var TB) = x.b[high(x.b)] = -1
|
||||
|
||||
|
||||
# in Nim proc (x: TB) is compatible to proc (x: TA),
|
||||
# but this is not type safe:
|
||||
var f = cast[proc (x: var TA) {.nimcall.}](bp)
|
||||
|
||||
@@ -3,7 +3,7 @@ import unittest
|
||||
type Obj = object
|
||||
foo: int
|
||||
|
||||
proc makeObj(x: int): Obj =
|
||||
proc makeObj(x: int): Obj =
|
||||
result.foo = x
|
||||
|
||||
suite "object basic methods":
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
type
|
||||
TFoo = ref object of RootObj
|
||||
Data: int
|
||||
Data: int
|
||||
TBar = ref object of TFoo
|
||||
nil
|
||||
TBar2 = ref object of TBar
|
||||
|
||||
@@ -18,7 +18,7 @@ type
|
||||
of 0: arg: char
|
||||
of 1: s: string
|
||||
else: wtf: bool
|
||||
|
||||
|
||||
var
|
||||
x: TMyObject
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ discard """
|
||||
|
||||
# Disabled since some versions of GCC ignore the 'packed' attribute
|
||||
|
||||
# Test
|
||||
# Test
|
||||
|
||||
type
|
||||
Foo {.packed.} = object
|
||||
@@ -21,12 +21,12 @@ type
|
||||
|
||||
Bar {.packed.} = object
|
||||
a: int8
|
||||
b: int16
|
||||
|
||||
b: int16
|
||||
|
||||
Daz {.packed.} = object
|
||||
a: int32
|
||||
b: int8
|
||||
c: int32
|
||||
b: int8
|
||||
c: int32
|
||||
|
||||
|
||||
var f = Foo(a: 1, b: 1)
|
||||
|
||||
@@ -8,12 +8,12 @@ type
|
||||
TMyType = object {.inheritable.}
|
||||
len: int
|
||||
data: string
|
||||
|
||||
|
||||
TOtherType = object of TMyType
|
||||
|
||||
proc p(x: TMyType): bool =
|
||||
|
||||
proc p(x: TMyType): bool =
|
||||
return x of TOtherType
|
||||
|
||||
|
||||
var
|
||||
m: TMyType
|
||||
n: TOtherType
|
||||
|
||||
@@ -5,13 +5,13 @@ discard """
|
||||
type
|
||||
TA = object of TObject
|
||||
x, y: int
|
||||
|
||||
|
||||
TB = object of TA
|
||||
z: int
|
||||
|
||||
|
||||
TC = object of TB
|
||||
whatever: string
|
||||
|
||||
|
||||
proc p(a: var TA) = echo "a"
|
||||
proc p(b: var TB) = echo "b"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user