From a7151552e7c4b04cbfbe88c004342c697c8791dc Mon Sep 17 00:00:00 2001 From: hunshcn Date: Tue, 14 May 2024 21:56:42 +0800 Subject: [PATCH] more tests --- gazelle/python/file_parser_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gazelle/python/file_parser_test.go b/gazelle/python/file_parser_test.go index 018de033f6..526afc7716 100644 --- a/gazelle/python/file_parser_test.go +++ b/gazelle/python/file_parser_test.go @@ -77,7 +77,7 @@ func TestParseImportStatements(t *testing.T) { }, { name: "import as", - code: "import os as b\nfrom foo import bar as c", + code: "import os as b\nfrom foo import bar as c# 123", filepath: "abc.py", result: []module{ { @@ -157,6 +157,11 @@ func TestParseComments(t *testing.T) { code: "if True:\n # a = 1\n # b = 2", result: []comment{"# a = 1", "# b = 2"}, }, + { + name: "has comment inline", + code: "import os# 123\nfrom pathlib import Path as b#456", + result: []comment{"# 123", "#456"}, + }, } for _, u := range units { t.Run(u.name, func(t *testing.T) {