File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -616,3 +616,32 @@ def testColoring(self):
616616 def testConfigureOutputWithNoParameters (self ):
617617 with self .assertRaises (TypeError ):
618618 ic .configureOutput ()
619+
620+ def test_multiline_strings_output (self ):
621+
622+ test1 = "A\\ veryvery\\ long\\ path\\ to\\ no\\ even\\ longer\\ HelloWorld _01_Heritisfinallythe file.file"
623+ test2 = r"A\veryvery\long\path\to\no\even\longer\HelloWorld _01_Heritisfinallythe file.file"
624+ test3 = "line\n line"
625+
626+ with disableColoring (), captureStandardStreams () as (_ , err ):
627+ ic (test1 )
628+ curr_res = err .getvalue ().strip ()
629+ expected = r"ic| test1: 'A\\veryvery\\long\\path\\to\\no\\even\\longer\\HelloWorld _01_Heritisfinallythe file.file'"
630+ self .assertEqual (curr_res , expected )
631+ del curr_res , expected
632+
633+ with disableColoring (), captureStandardStreams () as (_ , err ):
634+ ic (test2 )
635+ curr_res = err .getvalue ().strip ()
636+ # expected = r"ic| test2: 'A\\veryvery\\long\\path\\to\\no\\even\\longer\\HelloWorld _01_Heritisfinallythe file.file'"
637+ expected = r"ic| test2: 'A\\veryvery\\long\\path\\to\\no\\even\\longer\\HelloWorld _01_Heritisfinallythe file.file'"
638+ self .assertEqual (curr_res , expected )
639+ del curr_res , expected
640+
641+ with disableColoring (), captureStandardStreams () as (_ , err ):
642+ ic (test3 )
643+ curr_res = err .getvalue ().strip ()
644+ expected = r"""ic| test3: '''line
645+ line'''"""
646+ self .assertEqual (curr_res , expected )
647+ del curr_res , expected
You can’t perform that action at this time.
0 commit comments