Add strutils.indentation and make unindent use it (#15264)

* Add strutils.indentation and make unindent use it

* Code style

* Fix bootstrapping

* Improve wording

* Fix test

* Introduce without breaking change

* Fix

* Reduce diff

* Fix docs link

* Add since annotation

* Update changelog
This commit is contained in:
Clyybber 2020-09-22 10:43:12 +02:00 • committed by GitHub
commit d67c5cb751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 11 deletions

View file

@ -435,3 +435,25 @@ block:
doAssert a == f1
doAssert b == f2
doAssert c == f3
block:
assert 0 == indentation """
hey
low
there
"""
assert 2 == indentation """
hey
low
there
"""
assert 2 == indentation """ hey
low
there
"""
assert 2 == indentation """ hey
low
there"""
assert 0 == indentation ""
assert 0 == indentation " \n \n"
assert 0 == indentation " "