mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
Add test for ExtractTupleElementInstruction.getResultType()
This commit is contained in:
6
ql/test/library-tests/semmle/go/IR/test.expected
Normal file
6
ql/test/library-tests/semmle/go/IR/test.expected
Normal file
@@ -0,0 +1,6 @@
|
||||
| test.go:9:2:9:16 | ... := ...[0] | bool |
|
||||
| test.go:9:2:9:16 | ... := ...[1] | bool |
|
||||
| test.go:15:2:15:20 | ... := ...[0] | string |
|
||||
| test.go:15:2:15:20 | ... := ...[1] | bool |
|
||||
| test.go:21:2:21:22 | ... := ...[0] | string |
|
||||
| test.go:21:2:21:22 | ... := ...[1] | bool |
|
||||
23
ql/test/library-tests/semmle/go/IR/test.go
Normal file
23
ql/test/library-tests/semmle/go/IR/test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func testChannel() {
|
||||
var ch chan bool
|
||||
got, ok := <-ch
|
||||
fmt.Printf("%v %v", got, ok)
|
||||
}
|
||||
|
||||
func testMap() {
|
||||
var m map[string]string
|
||||
got, ok := m["key"]
|
||||
fmt.Printf("%v %v", got, ok)
|
||||
}
|
||||
|
||||
func testTypeAssert() {
|
||||
var i interface{}
|
||||
got, ok := i.(string)
|
||||
fmt.Printf("%v %v", got, ok)
|
||||
}
|
||||
4
ql/test/library-tests/semmle/go/IR/test.ql
Normal file
4
ql/test/library-tests/semmle/go/IR/test.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import go
|
||||
|
||||
from IR::ExtractTupleElementInstruction extract
|
||||
select extract, extract.getResultType()
|
||||
Reference in New Issue
Block a user