未验证 提交 9ddd31ff 编写于 作者: P Phodal Huang

feat: add basic remove unused test for cache

上级 fd89e302
package polymorphism;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
public class Overload {
void demo(int a) {
System.out.println("a: " + a);
}
}
......@@ -22,7 +22,7 @@ var refactorCmd = &cobra.Command{
app := NewMoveClassApp(moveConfig, path)
app.Analysis()
app2 := NewRemoveUnusedImportApp(moveConfig, path)
app2 := NewRemoveUnusedImportApp(path)
app2.Analysis()
}
......
package unused
import (
"fmt"
"github.com/antlr/antlr4/runtime/Go/antlr"
base2 "github.com/phodal/coca/core/domain/refactor/base"
models2 "github.com/phodal/coca/core/domain/refactor/base/models"
"github.com/phodal/coca/core/support"
"fmt"
"github.com/antlr/antlr4/runtime/Go/antlr"
"io/ioutil"
"os"
"path/filepath"
......@@ -21,8 +21,7 @@ type RemoveUnusedImportApp struct {
var nodes []models2.JMoveStruct
func NewRemoveUnusedImportApp(config string, pPath string) *RemoveUnusedImportApp {
moveConfig = config
func NewRemoveUnusedImportApp(pPath string) *RemoveUnusedImportApp {
configPath = pPath
nodes = nil
......
package unused
import (
. "github.com/onsi/gomega"
"testing"
)
func TestRemoveUnusedImportApp_Analysis(t *testing.T) {
g := NewGomegaWithT(t)
codePath := "../../../../_fixtures/refactor/unused"
app := NewRemoveUnusedImportApp(codePath)
app.Analysis()
g.Expect(true).To(Equal(true))
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册