tdot2.nim 762 B

1234567891011121314151617181920212223242526272829
  1. # Test basic editing. We replace the 'false' by 'true' to
  2. # see whether then the z field is suggested.
  3. const zField = 0i32
  4. type
  5. Foo = object
  6. x, y: int
  7. when zField == 1i32:
  8. z: string
  9. proc main(f: Foo) =
  10. f.#[!]#
  11. # the tester supports the spec section at the bottom of the file and
  12. # this way, the line numbers more often stay the same
  13. discard """
  14. $nimsuggest --tester --maxresults:3 $file
  15. >sug $1
  16. sug;;skField;;x;;int;;$file;;8;;4;;"";;100;;None
  17. sug;;skField;;y;;int;;$file;;8;;7;;"";;100;;None
  18. sug;;skProc;;tdot2.main;;proc (f: Foo);;$file;;12;;5;;"";;100;;None
  19. !edit 0i32 1i32
  20. >sug $1
  21. sug;;skField;;x;;int;;$file;;8;;4;;"";;100;;None
  22. sug;;skField;;y;;int;;$file;;8;;7;;"";;100;;None
  23. sug;;skField;;z;;string;;$file;;10;;6;;"";;100;;None
  24. """