@@ -56,8 +56,8 @@ func TestPythonSupportPluginGrammarHighlighting(t *testing.T) {
5656 t .Fatal (err )
5757 }
5858 grammar := h .app .syntaxRegistry ().SyntaxForPath (path )
59- if grammar == nil || grammar .Language ().Scope != "source.python.lithe-support " {
60- t .Fatal ("installed Python grammar was not loaded " )
59+ if grammar == nil || grammar .Language ().Scope != "source.python" {
60+ t .Fatal ("installed plugin did not preserve the built-in Python grammar " )
6161 }
6262 h .app .openFile (p , path )
6363 h .settle ()
@@ -76,21 +76,9 @@ func TestPythonSupportPluginGrammarHighlighting(t *testing.T) {
7676 t .Fatalf ("line %d %q highlights = %v, bundled Python = %v" , lineIndex + 1 , line , got , want )
7777 }
7878 for i , token := range got {
79- if token = = want [i ] {
80- continue
79+ if token ! = want [i ] {
80+ t . Errorf ( "line %d %q token = %v, bundled Python = %v" , lineIndex + 1 , line , token , want [ i ])
8181 }
82- end := len (line )
83- if i + 1 < len (want ) {
84- end = int (want [i + 1 ].Start )
85- }
86- // Both registries tokenize operators through the bundled grammar. The
87- // plugin root uses the generic classifier, styling those symbols as keywords.
88- if token .Start == want [i ].Start && token .Name .String () == "keyword" &&
89- want [i ].Name .String () == "delimiter" &&
90- strings .Trim (line [token .Start :end ], "=+<>" ) == "" {
91- continue
92- }
93- t .Errorf ("line %d %q token = %v, bundled Python = %v" , lineIndex + 1 , line , token , want [i ])
9482 }
9583 }
9684}
@@ -99,7 +87,7 @@ func TestPythonSupportPluginShebang(t *testing.T) {
9987 h := openPythonGrammarWorkbench (t )
10088 p := h .app .project
10189 path := filepath .Join (p .root , "script" )
102- const body = "#!/usr/bin/env -S python3 -I\n count: int = 42\n "
90+ const body = "#!/usr/bin/env -S /usr/bin/ python3 -I\n count: int = 42\n "
10391 if err := os .WriteFile (path , []byte (body ), 0o600 ); err != nil {
10492 t .Fatal (err )
10593 }
0 commit comments