Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hunshcn committed May 14, 2024
1 parent b8a9774 commit a715155
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gazelle/python/file_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit a715155

Please sign in to comment.