Skip to content

Commit

Permalink
fix: update filename for TestParseFromStackTrace/ExistingDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
nedpals committed Feb 2, 2024
1 parent bbd18c4 commit de60a4e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions errgoengine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ func TestParseFromStackTrace(t *testing.T) {

t.Run("ExistingDoc", func(t *testing.T) {
currentLang := python.Language
contextData := Setup(currentLang, "main.py", lib.Position{Line: 2})
contextData := Setup(currentLang, "hello.py", lib.Position{Line: 2})
files := fstest.MapFS{
"main.py": &fstest.MapFile{
Data: []byte(`def main():
a = 1
print(a/0)
`),
"hello.py": &fstest.MapFile{
Data: []byte(`a = 1
print(a/0)`),
},
}

Expand All @@ -188,9 +186,9 @@ func TestParseFromStackTrace(t *testing.T) {
}

// check if the document is parsed
doc, ok := contextData.Documents["main.py"]
doc, ok := contextData.Documents["hello.py"]
if !ok {
t.Error("main.py document not found")
t.Error("hello.py document not found")
}

// check if doc language is same as currentLang
Expand All @@ -213,7 +211,7 @@ func TestParseFromStackTrace(t *testing.T) {
}

newFiles := fstest.MapFS{
"main.py": &fstest.MapFile{
"hello.py": &fstest.MapFile{
Data: []byte(`def main():
print("Hello, World!")
`),
Expand All @@ -232,9 +230,9 @@ func TestParseFromStackTrace(t *testing.T) {
}

// check if the document is parsed
doc, ok = contextData.Documents["main.py"]
doc, ok = contextData.Documents["hello.py"]
if !ok {
t.Error("main.py document not found")
t.Error("hello.py document not found")
}

// check if doc language is same as currentLang
Expand Down

0 comments on commit de60a4e

Please sign in to comment.