From 530a32d787a9e6659d38c97240dcddbf3c52ce14 Mon Sep 17 00:00:00 2001 From: williamfzc <178894043@qq.com> Date: Sat, 27 May 2023 00:07:18 +0800 Subject: [PATCH] fix: test --- graph/api_file_test.go | 3 ++- graph/api_test.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/graph/api_file_test.go b/graph/api_file_test.go index 2839311..d124b33 100644 --- a/graph/api_file_test.go +++ b/graph/api_file_test.go @@ -1,6 +1,7 @@ package graph import ( + "github.com/opensibyl/sibyl2/pkg/core" "path/filepath" "runtime" "testing" @@ -11,7 +12,7 @@ import ( func TestFuncGraph_ToFileGraph(t *testing.T) { _, curFile, _, _ := runtime.Caller(0) src := filepath.Dir(filepath.Dir(curFile)) - fg, err := CreateFuncGraphFromDirWithLSIF(src, filepath.Join(src, "dump.lsif")) + fg, err := CreateFuncGraphFromDirWithLSIF(src, filepath.Join(src, "dump.lsif"), core.LangGo) assert.Nil(t, err) assert.NotEmpty(t, fg.cache) fileGraph, err := fg.ToFileGraph() diff --git a/graph/api_test.go b/graph/api_test.go index 2ab12e1..e5cc20b 100644 --- a/graph/api_test.go +++ b/graph/api_test.go @@ -1,6 +1,7 @@ package graph import ( + "github.com/opensibyl/sibyl2/pkg/core" "os" "path/filepath" "runtime" @@ -12,7 +13,7 @@ import ( func TestFuncGraph(t *testing.T) { _, curFile, _, _ := runtime.Caller(0) src := filepath.Dir(filepath.Dir(curFile)) - fg, err := CreateFuncGraphFromDirWithLSIF(src, filepath.Join(src, "dump.lsif")) + fg, err := CreateFuncGraphFromDirWithLSIF(src, filepath.Join(src, "dump.lsif"), core.LangGo) assert.Nil(t, err) assert.NotEmpty(t, fg.cache) @@ -41,7 +42,7 @@ func TestFuncGraph(t *testing.T) { t.Run("RemoveNode", func(t *testing.T) { before, err := fg.g.Order() assert.Nil(t, err) - err = fg.RemoveNodeById("graph/api_test.go:#12-#50:graph||TestFuncGraph|*testing.T|") + err = fg.RemoveNodeById("graph/api_test.go:#13-#51:graph||TestFuncGraph|*testing.T|") assert.Nil(t, err) after, err := fg.g.Order() assert.Nil(t, err)