forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtdot4.nim
21 lines (16 loc) · 852 Bytes
/
tdot4.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Test that already used suggestions are prioritized
from system import string, echo
import fixtures/mstrutils
proc main(inp: string): string =
# use replace here and see if it occurs in the result, it should gain
# priority:
result = inp.replace(" ", "a").replace("b", "c")
echo "string literal here".#[!]#
# priority still tested, but limit results to avoid failures from other output
discard """
$nimsuggest --tester --maxresults:2 $file
>sug $1
sug;;skProc;;tdot4.main;;proc (inp: string): string;;$file;;6;;5;;"";;100;;None
sug;;skFunc;;mstrutils.replace;;proc (s: string, sub: string, by: string): string{.noSideEffect, gcsafe, locks: 0.};;*fixtures/mstrutils.nim;;9;;5;;"this is a test version of strutils.replace, it simply returns `by`";;100;;None
"""
# TODO - determine appropriate behaviour for further suggest output and test it