nimsuggest: fix and re-enable old tests (#16401)
A number of nimsuggest tests were disabled for various reasons, sometimes due to brittleness. These tests have been fixed where needed and most have are now enabled -- details below. The updates are meant to provide better regression coverage for future nimsuggest improvements. To avoid brittleness some tests were refactored. Impact: * test coverage has now increased * faster execution of the test suite * tests are less likely to break due to stdlib changes Re-enabled Test & Test Description: * `tchk1.nim`: check (chk) via nimsuggest works at end of file * `tdot4.nim`: prioritize already used completion * `tinclude.nim`: definition lookup (def) with includes * `tstrutils.nim` -> `tdef2.nim`: test template definition lookup (def) * `tsug_regression.nim`: regression test for [nimsuggest #52](https://github.com/nim-lang/nimsuggest/issues/52) * `ttemplate_highlight.nim`: per the file name * `twithin_macro_prefix.nim`: suggest within a macro with a prefix Tests Not Re-Enabled: * `twithin_macro.nim` still disabled as it doesn't provide a good test signal * EPC highlight tests remain disabled -- requires out of scope tester changes Additional Notes: * todos added in comments for follow-up work
This commit is contained in:
parent
fa1a04188f
commit
4cf605dcf6
19 changed files with 292 additions and 376 deletions
|
|
@ -1,8 +1,19 @@
|
|||
# import that has an include, def calls must work into and out of includes
|
||||
import fixtures/minclude_import
|
||||
|
||||
proc go() =
|
||||
discard create().say()
|
||||
|
||||
go()
|
||||
|
||||
discard """
|
||||
disabled:true
|
||||
$nimsuggest --tester compiler/nim.nim
|
||||
>def compiler/semexprs.nim:25:50
|
||||
def;;skType;;ast.PSym;;PSym;;*ast.nim;;707;;2;;"";;100
|
||||
>def compiler/semexprs.nim:25:50
|
||||
def;;skType;;ast.PSym;;PSym;;*ast.nim;;707;;2;;"";;100
|
||||
$nimsuggest --tester $file
|
||||
>def $path/tinclude.nim:5:14
|
||||
def;;skProc;;minclude_import.create;;proc (greeting: string, subject: string): Greet{.noSideEffect, gcsafe, locks: 0.};;*fixtures/minclude_include.nim;;3;;5;;"";;100
|
||||
>def $path/fixtures/minclude_include.nim:3:71
|
||||
def;;skType;;minclude_types.Greet;;Greet;;*fixtures/minclude_types.nim;;4;;2;;"";;100
|
||||
>def $path/fixtures/minclude_include.nim:3:71
|
||||
def;;skType;;minclude_types.Greet;;Greet;;*fixtures/minclude_types.nim;;4;;2;;"";;100
|
||||
"""
|
||||
|
||||
# TODO test/fix if the first `def` is not first or repeated we get no results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue