tsug_regression.nim 1.3 KB

123456789101112131415161718192021222324252627282930
  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 = initSet[int]()
  8. set1 = initSet[X]()
  9. set2 = initSet[ref int]()
  10. map0 = initTable[int, int]()
  11. map1 = initOrderedTable[string, int]()
  12. cfg = loadConfig("file")
  13. map0.#[!]#
  14. discard """
  15. disabled:true
  16. $nimsuggest --tester $file
  17. >sug $1
  18. sug;;skProc;;tables.getOrDefault;;proc (t: Table[getOrDefault.A, getOrDefault.B], key: A): B;;$lib/pure/collections/tables.nim;;178;;5;;"";;100;;None
  19. sug;;skProc;;tables.hasKey;;proc (t: Table[hasKey.A, hasKey.B], key: A): bool;;$lib/pure/collections/tables.nim;;233;;5;;"returns true iff `key` is in the table `t`.";;100;;None
  20. sug;;skProc;;tables.add;;proc (t: var Table[add.A, add.B], key: A, val: B);;$lib/pure/collections/tables.nim;;309;;5;;"puts a new (key, value)-pair into `t` even if ``t[key]`` already exists.";;100;;None
  21. sug;;skIterator;;tables.allValues;;iterator (t: Table[allValues.A, allValues.B], key: A): B{.inline.};;$lib/pure/collections/tables.nim;;225;;9;;"iterates over any value in the table `t` that belongs to the given `key`.";;100;;None
  22. sug;;skProc;;tables.clear;;proc (t: var Table[clear.A, clear.B]);;$lib/pure/collections/tables.nim;;121;;5;;"Resets the table so that it is empty.";;100;;None
  23. *
  24. """