From e80465dacf50f260abec30ae57d37b298c93fd83 Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Fri, 4 Sep 2015 23:04:32 +0200 Subject: tests: Trim .nim files trailing whitespace via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} + --- tests/seq/tseqcon.nim | 90 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'tests/seq/tseqcon.nim') diff --git a/tests/seq/tseqcon.nim b/tests/seq/tseqcon.nim index 6e0a5b56d..902ac3485 100644 --- a/tests/seq/tseqcon.nim +++ b/tests/seq/tseqcon.nim @@ -2,50 +2,50 @@ discard """ file: "tseqcon.nim" output: "Hithere, what\'s your name?Hathere, what\'s your name?" """ -# Test the add proc for sequences and strings - -const - nestedFixed = true - -type - TRec {.final.} = object - x, y: int - s: string - seq: seq[string] - TRecSeq = seq[TRec] - -proc test() = - var s, b: seq[string] - s = @[] - add(s, "Hi") - add(s, "there, ") - add(s, "what's your name?") - - b = s # deep copying here! - b[0][1] = 'a' - - for i in 0 .. len(s)-1: - write(stdout, s[i]) - for i in 0 .. len(b)-1: - write(stdout, b[i]) - - -when nestedFixed: - proc nested() = - var - s: seq[seq[string]] - for i in 0..10_000: # test if the garbage collector - # now works with sequences - s = @[ - @["A", "B", "C", "D"], - @["E", "F", "G", "H"], - @["I", "J", "K", "L"], - @["M", "N", "O", "P"]] - -test() -when nestedFixed: - nested() - -#OUT Hithere, what's your name?Hathere, what's your name? +# Test the add proc for sequences and strings + +const + nestedFixed = true + +type + TRec {.final.} = object + x, y: int + s: string + seq: seq[string] + TRecSeq = seq[TRec] + +proc test() = + var s, b: seq[string] + s = @[] + add(s, "Hi") + add(s, "there, ") + add(s, "what's your name?") + + b = s # deep copying here! + b[0][1] = 'a' + + for i in 0 .. len(s)-1: + write(stdout, s[i]) + for i in 0 .. len(b)-1: + write(stdout, b[i]) + + +when nestedFixed: + proc nested() = + var + s: seq[seq[string]] + for i in 0..10_000: # test if the garbage collector + # now works with sequences + s = @[ + @["A", "B", "C", "D"], + @["E", "F", "G", "H"], + @["I", "J", "K", "L"], + @["M", "N", "O", "P"]] + +test() +when nestedFixed: + nested() + +#OUT Hithere, what's your name?Hathere, what's your name? -- cgit 1.4.1-2-gfad0