tdot4.nim 865 B

12345678910111213141516171819202122
  1. # Test that already used suggestions are prioritized
  2. from system import string, echo
  3. import fixtures/mstrutils
  4. proc main(inp: string): string =
  5. # use replace here and see if it occurs in the result, it should gain
  6. # priority:
  7. result = inp.replace(" ", "a").replace("b", "c")
  8. echo "string literal here".#[!]#
  9. # priority still tested, but limit results to avoid failures from other output
  10. discard """
  11. $nimsuggest --tester --maxresults:2 $file
  12. >sug $1
  13. sug;;skProc;;tdot4.main;;proc (inp: string): string;;$file;;6;;5;;"";;100;;None
  14. sug;;skFunc;;mstrutils.replace;;proc (s: string, sub: string, by: string): string{.noSideEffect, gcsafe, raises: <inferred> [].};;*fixtures/mstrutils.nim;;9;;5;;"this is a test version of strutils.replace, it simply returns `by`";;100;;None
  15. """
  16. # TODO - determine appropriate behaviour for further suggest output and test it