diff options
author | Adam Strzelecki <ono@java.pl> | 2015-09-04 23:04:32 +0200 |
---|---|---|
committer | Adam Strzelecki <ono@java.pl> | 2015-09-04 23:04:32 +0200 |
commit | e80465dacf50f260abec30ae57d37b298c93fd83 (patch) | |
tree | 393394f8353a4adb49f95e6f13da1fd41681b7b3 /tests/seq/tseqcon.nim | |
parent | ac9c1cd6b980d4f00eeb52d1109d8e2c8cd21213 (diff) | |
download | Nim-e80465dacf50f260abec30ae57d37b298c93fd83.tar.gz |
tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
Diffstat (limited to 'tests/seq/tseqcon.nim')
-rw-r--r-- | tests/seq/tseqcon.nim | 90 |
1 files changed, 45 insertions, 45 deletions
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? |