Documents idetools skLabel with failure test case.

This commit is contained in:
Grzegorz Adam Hankiewicz
2013-07-06 19:42:36 +02:00
parent 4ed44fc634
commit 383d047763
3 changed files with 34 additions and 0 deletions

View File

@@ -295,6 +295,22 @@ posterior instances of the iterator.
col 7: "iterates over any unicode character of the string `s`."
skLabel
-------
| **Third column**: module + [n scope nesting] + name.
| **Fourth column**: always the empty string.
| **Docstring**: always the empty string.
.. code-block:: nimrod
proc test(text: string) =
var found = -1
block loops:
--> col 2: $MODULE.test.loops
col 3: ""
col 7: ""
skLet
-----

View File

@@ -41,3 +41,15 @@ proc newLit(x: int): PLiteral = PLiteral(x: x)
proc newPlus(a, b: PExpr): PPlusExpr = PPlusExpr(a: a, b: b)
echo eval(newPlus(newPlus(newLit(1), newLit(2)), newLit(4)))
proc findVowelPosition(text: string) =
var found = -1
block loops:
for i, letter in pairs(text):
for j in ['a', 'e', 'i', 'o', 'u']:
if letter == j:
found = i
break loops # leave both for-loops
echo found
findVowelPosition("Zerg") # should output 1, position of vowel.

View File

@@ -42,3 +42,9 @@ def\tskField\t$MODULE.TPerson.name\tbad_string\t
> idetools --track:$TESTNIM,43,7 --def $SILENT
def\tskMethod\t$MODULE.eval\tproc \(PPlusExpr\): int\t
> idetools --track:$TESTNIM,47,8 --def $SILENT
def\tskLabel\t$MODULE.findVowelPosition.loops\t\t
# For some reason the use of the label with break displaces its position.
> idetools --track:$TESTNIM,52,16 --def $SILENT
def\tskLabel\t$MODULE.findVowelPosition.loops\t\t