diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-26 19:57:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-09-27 21:04:22 -0400 |
commit | 21c9f7c85e90f4d3ef539d41a36a24b2f26ad3d1 (patch) | |
tree | 9a21cb0a71c185853eab75c7d1844600a4a28471 /scripts/maint/annotate_ifdef_directives.py | |
parent | f1e0665c934db49cc86936a17a3a1247db9e3337 (diff) | |
download | tor-21c9f7c85e90f4d3ef539d41a36a24b2f26ad3d1.tar.gz tor-21c9f7c85e90f4d3ef539d41a36a24b2f26ad3d1.zip |
Annotate_ifdef_directives: doctest for 80-column lines.
Diffstat (limited to 'scripts/maint/annotate_ifdef_directives.py')
-rwxr-xr-x | scripts/maint/annotate_ifdef_directives.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/maint/annotate_ifdef_directives.py b/scripts/maint/annotate_ifdef_directives.py index 6ff9b8ec4c..b4326f9822 100755 --- a/scripts/maint/annotate_ifdef_directives.py +++ b/scripts/maint/annotate_ifdef_directives.py @@ -144,6 +144,18 @@ def commented_line(fmt, argument, maxwidth=LINE_WIDTH): >>> commented_line("#endif /* %s */\n", "((1+2) && defined(FOO))", 32) '#endif /* ((1+2) && defi...) */\n' + + The default line limit is 80 characters including the newline: + + >>> long_argument = "long " * 100 + >>> long_line = commented_line("#endif /* %s */\n", long_argument) + >>> len(long_line) + 80 + + >>> long_line[:40] + '#endif /* long long long long long long ' + >>> long_line[40:] + 'long long long long long long lon... */\n' """ assert fmt.endswith("\n") result = fmt % argument |