Skip to content

Some tests and small refactor to KateViewInternal::word{Prev,Next}

I was reading the code of those methods and noticed 2 things:

  • The basic functionality wasn't properly tested (when not using camel case cursor). I messed up the implementation on purpose and no test failed.
  • The code was very unclear to me as a first reader.

I added some very basic tests using wordLeft and wordRight that now fail when I change little bits of the implementation in KateViewInternal. A lot of cases are lacking but the basic behavior is now tested.

I made an small refactor to the implementation and IMO it's a bit clearer now. It's not a game changer or anything but IMO it's a little improvement.

Merge request reports