Skip to content

Commit d53d024

Browse files
committed
Update test to avoid duplicates
1 parent 38831f2 commit d53d024

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.expected

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ callTargets
1313
| test.go:57:2:57:29 | call to ImplementMe | test.go:46:1:46:87 | function declaration | ImplementMe |
1414
| test.go:57:2:57:29 | call to ImplementMe | test.go:53:1:53:85 | function declaration | ImplementMe |
1515
#select
16-
| file://:0:0:0:0 | basic interface type | * Impl1 |
17-
| file://:0:0:0:0 | basic interface type | * Impl2 |
18-
| file://:0:0:0:0 | basic interface type | * Impl3 |
19-
| file://:0:0:0:0 | basic interface type | * Impl4 |
20-
| file://:0:0:0:0 | basic interface type | * Impl5 |
21-
| file://:0:0:0:0 | basic interface type | * Impl6 |
22-
| file://:0:0:0:0 | basic interface type | Impl1 |
23-
| file://:0:0:0:0 | basic interface type | Impl2 |
24-
| file://:0:0:0:0 | basic interface type | Impl3 |
25-
| file://:0:0:0:0 | basic interface type | Impl4 |
26-
| file://:0:0:0:0 | basic interface type | Impl5 |
27-
| file://:0:0:0:0 | basic interface type | Impl6 |
28-
| file://:0:0:0:0 | basic interface type | interface { ImplementMe func(func(struct { x int }) ) } |
16+
| interface { ImplementMe func(func(struct { x int }) ) } | * Impl1 |
17+
| interface { ImplementMe func(func(struct { x int }) ) } | * Impl2 |
18+
| interface { ImplementMe func(func(struct { x int }) ) } | * Impl3 |
19+
| interface { ImplementMe func(func(struct { x int }) ) } | * Impl4 |
20+
| interface { ImplementMe func(func(struct { x int }) ) } | * Impl5 |
21+
| interface { ImplementMe func(func(struct { x int }) ) } | * Impl6 |
22+
| interface { ImplementMe func(func(struct { x int }) ) } | Impl1 |
23+
| interface { ImplementMe func(func(struct { x int }) ) } | Impl2 |
24+
| interface { ImplementMe func(func(struct { x int }) ) } | Impl3 |
25+
| interface { ImplementMe func(func(struct { x int }) ) } | Impl4 |
26+
| interface { ImplementMe func(func(struct { x int }) ) } | Impl5 |
27+
| interface { ImplementMe func(func(struct { x int }) ) } | Impl6 |
28+
| interface { ImplementMe func(func(struct { x int }) ) } | interface { ImplementMe func(func(struct { x int }) ) } |

go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.ql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ query predicate callTargets(DataFlow::CallNode cn, FuncDef target, string target
77
from InterfaceType i, Type impl
88
where
99
i.hasMethod("ImplementMe", _) and
10-
impl.implements(i)
11-
select i, impl.pp()
10+
impl.implements(i) and
11+
// Avoid duplicates caused by different types which are the same
12+
// when you ignore aliases.
13+
impl = impl.getDeepUnaliasedType() and
14+
i = i.getDeepUnaliasedType()
15+
select i.pp(), impl.pp()

0 commit comments

Comments
 (0)