Exemple #1
0
func TestOracleCGoImport(t *testing.T) {
	pkg, err := parser.ParsePackage("github.com/t-yuki/godoc2puml/annotator/testdata/cgoimport")
	if err != nil {
		t.Fatal(err)
	}
	err = annotator.Oracle(pkg)
	if err != nil {
		t.Fatal(err)
	}
	b, _ := json.MarshalIndent(pkg, "", "\t")
	t.Logf("%s", b)
}
Exemple #2
0
func TestOracleGoAST(t *testing.T) {
	name := "go/ast"
	pkg, err := parser.ParsePackage(name)
	if err != nil {
		t.Fatal(err)
	}
	err = annotator.Oracle(pkg)
	if err != nil {
		t.Fatal(err)
	}
	b, _ := json.MarshalIndent(pkg, "", "\t")
	t.Logf("%s", b)
}
Exemple #3
0
func TestOracleStdLibs(t *testing.T) {
	for _, name := range []string{"io", "net", "net/http"} {
		pkg, err := parser.ParsePackage(name)
		if err != nil {
			t.Fatal(err)
		}
		err = annotator.Oracle(pkg)
		if err != nil {
			t.Fatal(err)
		}
		b, _ := json.MarshalIndent(pkg, "", "\t")
		t.Logf("%s", b)
	}
}