From de60a4eb1fb40efe09bcc60b3d4b302c1c1ed609 Mon Sep 17 00:00:00 2001 From: Ned Palacios Date: Fri, 2 Feb 2024 22:05:02 +0800 Subject: [PATCH] fix: update filename for TestParseFromStackTrace/ExistingDoc --- errgoengine_test.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/errgoengine_test.go b/errgoengine_test.go index 83cf5e1..460f178 100644 --- a/errgoengine_test.go +++ b/errgoengine_test.go @@ -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)`), }, } @@ -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 @@ -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!") `), @@ -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