summary refs log tree commit diff stats
path: root/tests/accept/run/titer6.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-11-19 12:23:03 +0100
committerAraq <rumpf_a@web.de>2011-11-19 12:23:03 +0100
commitd0772feb08baaea12bfdad0a7c20a41733f977bd (patch)
tree706734d78ba5463e12614a5cad5dd3981b33f49f /tests/accept/run/titer6.nim
parent62aa8bed3b6472e8acae530f7014e7e5b0c755b5 (diff)
downloadNim-d0772feb08baaea12bfdad0a7c20a41733f977bd.tar.gz
fixed some tests
Diffstat (limited to 'tests/accept/run/titer6.nim')
-rwxr-xr-xtests/accept/run/titer6.nim34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/accept/run/titer6.nim b/tests/accept/run/titer6.nim
index fa58e9a6c..dceace0e0 100755
--- a/tests/accept/run/titer6.nim
+++ b/tests/accept/run/titer6.nim
@@ -6,32 +6,32 @@ discard """
 
 import strutils
 
-iterator tokenize2(s: string, seps: set[char] = Whitespace): tuple[

-  token: string, isSep: bool] =

-  var i = 0

-  while i < s.len:

-    var j = i

-    if s[j] in seps:

+iterator tokenize2(s: string, seps: set[char] = Whitespace): tuple[
+  token: string, isSep: bool] =
+  var i = 0
+  while i < s.len:
+    var j = i
+    if s[j] in seps:
       while j < s.len and s[j] in seps: inc(j)
-      if j > i:

-        yield (copy(s, i, j-1), true)

+      if j > i:
+        yield (substr(s, i, j-1), true)
     else:
       while j < s.len and s[j] notin seps: inc(j)
-      if j > i:

-        yield (copy(s, i, j-1), false)

+      if j > i:
+        yield (substr(s, i, j-1), false)
     i = j
 
 for word, isSep in tokenize2("ta da", whiteSpace):
   var titer2TestVar = 0 
-  stdout.write(titer2TestVar)

+  stdout.write(titer2TestVar)
 
-proc wordWrap2(s: string, maxLineWidth = 80, 

-               splitLongWords = true,

-               seps: set[char] = whitespace,

-               newLine = "\n"): string  = 

-  result = ""

+proc wordWrap2(s: string, maxLineWidth = 80, 
+               splitLongWords = true,
+               seps: set[char] = whitespace,
+               newLine = "\n"): string  = 
+  result = ""
   for word, isSep in tokenize2(s, seps):
-    var w = 0 

+    var w = 0