tsug_regression.nim 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # test we only get suggestions, not error messages:
  2. import tables, sets, parsecfg
  3. type X = object
  4. proc main =
  5. # bug #52
  6. var
  7. set0 = initHashSet[int]()
  8. set1 = initHashSet[X]()
  9. set2 = initHashSet[ref int]()
  10. map0 = initTable[int, int]()
  11. map1 = initOrderedTable[string, int]()
  12. cfg = loadConfig("file")
  13. map0.#[!]#
  14. # the maxresults are limited as it seems there is sort or some other
  15. # instability that causes the suggestions to slightly differ between 32 bit
  16. # and 64 bit versions of nimsuggest
  17. discard """
  18. disabled:true
  19. $nimsuggest --tester --maxresults:4 $file
  20. >sug $1
  21. sug;;skProc;;tables.hasKey;;proc (t: Table[hasKey.A, hasKey.B], key: A): bool;;*/lib/pure/collections/tables.nim;;374;;5;;"Returns true *";;100;;None
  22. sug;;skProc;;tables.clear;;proc (t: var Table[clear.A, clear.B]);;*/lib/pure/collections/tables.nim;;567;;5;;"Resets the table so that it is empty*";;100;;None
  23. sug;;skProc;;tables.contains;;proc (t: Table[contains.A, contains.B], key: A): bool;;*/lib/pure/collections/tables.nim;;*;;5;;"Alias of *";;100;;None
  24. sug;;skProc;;tables.del;;proc (t: var Table[del.A, del.B], key: A);;*/lib/pure/collections/tables.nim;;*;;5;;"*";;100;;None
  25. """
  26. # TODO enable the tests
  27. # TODO: test/fix suggestion sorting - deprecated suggestions should rank lower