@@ -359,9 +359,9 @@ def test_full_source(runner, shell):
359359 ("bash" , {"COMP_WORDS" : "a b" , "COMP_CWORD" : "1" }, "plain,b\n " ),
360360 ("zsh" , {"COMP_WORDS" : "" , "COMP_CWORD" : "0" }, "plain\n a\n _\n plain\n b\n bee\n " ),
361361 ("zsh" , {"COMP_WORDS" : "a b" , "COMP_CWORD" : "1" }, "plain\n b\n bee\n " ),
362- ("fish" , {"COMP_WORDS" : "" , "COMP_CWORD" : "" }, "plain\n a \n _ \ n plain\n b \n bee \n " ),
363- ("fish" , {"COMP_WORDS" : "a b" , "COMP_CWORD" : "b" }, "plain\n b \n bee \n " ),
364- ("fish" , {"COMP_WORDS" : 'a "b' , "COMP_CWORD" : '"b' }, "plain\n b \n bee \n " ),
362+ ("fish" , {"COMP_WORDS" : "" , "COMP_CWORD" : "" }, "plain,a \ n plain,b \t bee \n " ),
363+ ("fish" , {"COMP_WORDS" : "a b" , "COMP_CWORD" : "b" }, "plain,b \t bee \n " ),
364+ ("fish" , {"COMP_WORDS" : 'a "b' , "COMP_CWORD" : '"b' }, "plain,b \t bee \n " ),
365365 ],
366366)
367367@pytest .mark .usefixtures ("_patch_for_completion" )
@@ -576,50 +576,3 @@ def cli(ctx, config_file):
576576 assert not current_warnings , "There should be no warnings to start"
577577 _get_completions (cli , args = [], incomplete = "" )
578578 assert not current_warnings , "There should be no warnings after either"
579-
580-
581- @pytest .mark .usefixtures ("_patch_for_completion" )
582- def test_fish_multiline_help_complete (runner ):
583- """Test Fish completion with multi-line help text doesn't cause errors."""
584- cli = Command (
585- "cli" ,
586- params = [
587- Option (
588- ["--at" , "--attachment-type" ],
589- type = (str , str ),
590- multiple = True ,
591- help = (
592- "\b \n Attachment with explicit mimetype,\n --at image.jpg image/jpeg"
593- ),
594- ),
595- Option (["--other" ], help = "Normal help" ),
596- ],
597- )
598-
599- result = runner .invoke (
600- cli ,
601- env = {
602- "COMP_WORDS" : "cli --" ,
603- "COMP_CWORD" : "--" ,
604- "_CLI_COMPLETE" : "fish_complete" ,
605- },
606- )
607-
608- # Should not fail
609- assert result .exit_code == 0
610-
611- # Output should contain escaped newlines, not literal newlines
612- # Fish expects: plain\n--at\n{help_with_\\n}
613- lines = result .output .split ("\n " )
614-
615- # Find the --at completion block (3 lines: type, value, help)
616- for i in range (0 , len (lines ) - 2 , 3 ):
617- if lines [i ] == "plain" and lines [i + 1 ] in ("--at" , "--attachment-type" ):
618- help_line = lines [i + 2 ]
619- # Help should have escaped newlines (\\n), not actual newlines
620- assert "\\ n" in help_line
621- # Should contain the example text
622- assert "image.jpg" in help_line .replace ("\\ n" , " " )
623- break
624- else :
625- pytest .fail ("--at completion not found in output" )
0 commit comments