Skip to content

Commit a803d3f

Browse files
committed
Add comments explaining tests
1 parent 09015df commit a803d3f

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

go/ql/test/library-tests/semmle/go/aliases/DataflowFields/embedding.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"test.com/basename/pkg2"
66
)
77

8+
// Tests that dataflow behaves as expected when loads and stores from a field traverse embeddings that use different type names.
9+
810
// pkg2.IntStruct is an alias for pkg1.IntStruct
911
// Note trickery with packages is necessary so that Go will assign the fields the same name as well as the same type.
1012

go/ql/test/library-tests/semmle/go/aliases/DataflowFields/simple.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package test
22

3+
// Tests that dataflow behaves as expected when field loads and stores, and pointer accesses, go via
4+
// types which are identical, but which use different aliases.
5+
36
func source() int { return 0 }
47
func sink(value int) {}
58

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package intfs
22

3+
// Tests that dataflow and interface implementation behave as expected when an interface
4+
// is implemented using a non-equal but identical type, i.e. an equal type after alias resolution.
5+
36
type IntAlias = int
47

58
type Target = interface {

go/ql/test/library-tests/semmle/go/aliases/MethodDefs/methods.go

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

3+
// Tests how interfaces defining identical types are represented in the database.
4+
35
type IntAlias = int
46

57
type S1 = struct{ x int }

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package aliases
22

3+
// Tests how defs and uses of fields are represented in the database
4+
// when identical types are used.
5+
36
type IntAlias = int
47

58
type S1 = struct{ x int }

0 commit comments

Comments
 (0)