Skip to content

Commit e8c3eef

Browse files
committed
add test
1 parent bcc3e2e commit e8c3eef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

_xtool/internal/config/config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package config
22

33
import (
4+
"fmt"
45
"os"
56
"path/filepath"
67
"strings"
@@ -59,10 +60,12 @@ func PkgHfileInfo(includes []string, args []string, mix bool) *PkgHfilesInfo {
5960
// not in the first level include maybe impl or third hfile
6061
filename := filepath.Clean(clang.GoString(inced.FileName()))
6162

62-
if len(incins) == 1 {
63+
if len(incins) <= 1 {
6364
info.Inters = append(info.Inters, filename)
6465
}
6566

67+
fmt.Println(filename, len(incins))
68+
6669
ref, ok := refMap[filename]
6770
if !ok {
6871
refMap[filename] = len(incins)
@@ -85,9 +88,10 @@ func PkgHfileInfo(includes []string, args []string, mix bool) *PkgHfilesInfo {
8588
}
8689

8790
for filename, ref := range refMap {
88-
if ref == 1 {
91+
if ref <= 1 {
8992
continue
9093
}
94+
fmt.Println(filename, ref)
9195

9296
if mix {
9397
info.Thirds = append(info.Thirds, filename)

0 commit comments

Comments
 (0)