@@ -359,10 +359,29 @@ def test_basic(self):
359359 the larch {0[1]} 1
360360 """ .format (self .delimiters )))
361361
362- def test_space_delimiter (self ):
362+ @support .subTests ('data' , [
363+ 'foo bar=baz' ,
364+ 'foo bar=baz' ,
365+ 'foo=bar=baz' ,
366+ 'foo = bar=baz' ,
367+ 'foo\t \t =\t \t bar=baz' ,
368+ ])
369+ def test_space_delimiter (self , data ):
363370 # gh-156353: Space should be accepted as a delimiter
364371 cf = self .newconfig (delimiters = (' ' , '=' ))
365- cf .read_string ("[all]\n foo bar=baz" )
372+ cf .read_string (f"[all]\n { data } " )
373+ self .assertEqual (cf .options ('all' ), ['foo' ])
374+ self .assertEqual (cf .get ('all' , 'foo' ), 'bar=baz' )
375+
376+ @support .subTests ('delimiter' , ' =:;#x\t \0 \N{RS} \N{CEDILLA} \N{CAT} ' )
377+ @support .subTests ('space_before' , ['' , ' ' , '\t ' , ' \t ' ])
378+ @support .subTests ('space_after' , ['' , ' ' , '\t ' , ' \t ' ])
379+ def test_any_delimiter (self , delimiter , space_before , space_after ):
380+ cf = self .newconfig (
381+ delimiters = (delimiter ,),
382+ inline_comment_prefixes = None ,
383+ )
384+ cf .read_string (f"[all]\n foo{ space_before } { delimiter } { space_after } bar=baz" )
366385 self .assertEqual (cf .options ('all' ), ['foo' ])
367386 self .assertEqual (cf .get ('all' , 'foo' ), 'bar=baz' )
368387
0 commit comments