]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Rewrite mostly useless assert in test_trans.py (#3810)
authorfreddiewanah <freddie.wanah@gmail.com>
Thu, 27 Jul 2023 16:51:28 +0000 (02:51 +1000)
committerGitHub <noreply@github.com>
Thu, 27 Jul 2023 16:51:28 +0000 (12:51 -0400)
commit133af572072bf7bc92c23a609773c2ea66e483b7
tree2641d77f37135a03d8e6da365a0ec7ec125592bd
parentd9d0a02d89207f712a40b6dabee708389208e558
Rewrite mostly useless assert in test_trans.py (#3810)

This PR updates an assert statement that checks the bounds of a
string-slicing operation. The updated assertion provides more accurate
and informative error handling by specifically checking the relative
values of the indices and the string length.

The original assertion was essentially checking if Python's string
slicing was behaving as expected. However, it wasn't providing any
guarantees or useful information about the bounds i and j themselves.

The updated assertion checks that the indices used for slicing are
within the bounds of the string. It will throw an AssertionError if the
indices are out of bounds or if i > j, providing a more specific and
informative error.
tests/test_trans.py