Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc1f951

Browse files
committed
Test section name using some strange characters, including a backslash
(SF bug #132288).
1 parent d4df94b commit cc1f951

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Lib/test/test_cfgparser.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ def basic(src):
1111
cf.readfp(sio)
1212
L = cf.sections()
1313
L.sort()
14-
verify(L == ['Commented Bar', 'Foo Bar',
15-
'Internationalized Stuff', 'Spacey Bar'],
14+
verify(L == [r'Commented Bar',
15+
r'Foo Bar',
16+
r'Internationalized Stuff',
17+
r'Section\with$weird%characters[' '\t',
18+
r'Spacey Bar',
19+
],
1620
"unexpected list of section names")
1721

1822
# The use of spaces in the section names serves as a regression test for
@@ -138,6 +142,7 @@ def expect_parse_error(exctype, src):
138142
foo = bar
139143
[Commented Bar]
140144
foo: bar ; comment
145+
[Section\with$weird%characters[""" '\t' r"""]
141146
[Internationalized Stuff]
142147
foo[bg]: Bulgarian
143148
foo=Default

0 commit comments

Comments
 (0)