mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Swift: add more tests for the generated parent-child relationship
This commit is contained in:
1319
swift/ql/test/library-tests/parent/child.expected
Normal file
1319
swift/ql/test/library-tests/parent/child.expected
Normal file
File diff suppressed because it is too large
Load Diff
9
swift/ql/test/library-tests/parent/child.ql
Normal file
9
swift/ql/test/library-tests/parent/child.ql
Normal file
@@ -0,0 +1,9 @@
|
||||
import swift
|
||||
import codeql.swift.generated.ParentChild
|
||||
import TestUtils
|
||||
|
||||
from AstNode parent, AstNode child, int index, string accessor
|
||||
where
|
||||
toBeTested(parent) and
|
||||
child = getImmediateChildAndAccessor(parent, index, accessor)
|
||||
select parent, index, accessor, child
|
||||
10
swift/ql/test/library-tests/parent/no_double_children.ql
Normal file
10
swift/ql/test/library-tests/parent/no_double_children.ql
Normal file
@@ -0,0 +1,10 @@
|
||||
import swift
|
||||
private import codeql.swift.generated.ParentChild
|
||||
|
||||
from AstNode parent, int index, AstNode child1, AstNode child2
|
||||
where
|
||||
child1 != child2 and
|
||||
child1 = getImmediateChildAndAccessor(parent, index, _) and
|
||||
child2 = getImmediateChildAndAccessor(parent, index, _)
|
||||
select parent, parent.getPrimaryQlClasses(), index, child1, child1.getPrimaryQlClasses(), child2,
|
||||
child2.getPrimaryQlClasses()
|
||||
9
swift/ql/test/library-tests/parent/no_double_indexes.ql
Normal file
9
swift/ql/test/library-tests/parent/no_double_indexes.ql
Normal file
@@ -0,0 +1,9 @@
|
||||
import swift
|
||||
private import codeql.swift.generated.ParentChild
|
||||
|
||||
from AstNode parent, int index1, int index2, AstNode child
|
||||
where
|
||||
index1 != index2 and
|
||||
child = getImmediateChildAndAccessor(parent, index1, _) and
|
||||
child = getImmediateChildAndAccessor(parent, index2, _)
|
||||
select parent, parent.getPrimaryQlClasses(), child, child.getPrimaryQlClasses(), index1, index2
|
||||
Reference in New Issue
Block a user