From 0ada598e59fa8576d8eeb7b4ff38fe4d16fe4fd5 Mon Sep 17 00:00:00 2001 From: milde Date: Mon, 6 May 2024 08:32:22 +0000 Subject: [PATCH] Mask trailing whitespace in test sample. Use Python string-escapes (`` \n\``) to mask a trailing whitespace in a "manpage" writer output sample. -1 one cannot use raw strings and must escape all literal backslashs. +1 allows removing all trailing whitespace with a simple script to avoid spurious whitespace in the repository. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@9689 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/test/test_writers/test_manpage.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/docutils/test/test_writers/test_manpage.py b/docutils/test/test_writers/test_manpage.py index 35509813c..4322f2335 100644 --- a/docutils/test/test_writers/test_manpage.py +++ b/docutils/test/test_writers/test_manpage.py @@ -165,9 +165,10 @@ and . in a line and at line start """, r""".\" Man page generated from reStructuredText. . -""" + indend_macros + r""".TH "SIMPLE" "1" "2009-08-05" "0.1" "text processing" +""" + indend_macros + """\ +.TH "SIMPLE" "1" "2009-08-05" "0.1" "text processing" .SH NAME -simple \- The way to go +simple \\- The way to go .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 @@ -183,29 +184,29 @@ General rule of life. .SH OPTIONS .INDENT 0.0 .TP -.BI \-\-config\fB= +.BI \\-\\-config\\fB= Read configuration settings from , if it exists. .TP -.B \-\-version\fP,\fB \-V -Show this program\(aqs version number and exit. +.B \\-\\-version\\fP,\\fB \\-V +Show this program\\(aqs version number and exit. .TP -.B \-\-help\fP,\fB \-h +.B \\-\\-help\\fP,\\fB \\-h Show this help message and exit. .UNINDENT .SH OTHER SECTION .sp -link to +link to \n\ .sp With mixed case. .sp -\fBATTENTION!:\fP +\\fBATTENTION!:\\fP .INDENT 0.0 .INDENT 3.5 Admonition with title .INDENT 0.0 -.IP \(bu 2 +.IP \\(bu 2 bullet list -.IP \(bu 2 +.IP \\(bu 2 bull and list .UNINDENT .UNINDENT @@ -218,17 +219,17 @@ something important .UNINDENT .UNINDENT .sp -\&. period at line start. +\\&. period at line start. .sp and . in a line and at line start -\&.in a paragraph +\\&.in a paragraph .SH AUTHOR someone@somewhere.net Arbitrary field: some text .SH COPYRIGHT public domain -.\" Generated by docutils manpage writer. +.\\" Generated by docutils manpage writer. . """], ] -- 2.11.4.GIT