mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
aggregate the tests in library-tests/XML into a single .ql file
This commit is contained in:
@@ -1 +0,0 @@
|
||||
| tst.xml:3:3:3:20 | foo=bar | tst.xml:3:3:3:37 | child | foo | bar |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLAttribute attr
|
||||
select attr, attr.getElement(), attr.getName(), attr.getValue()
|
||||
@@ -1 +0,0 @@
|
||||
| tst.xml:4:3:4:21 | a comment | a comment |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLComment c
|
||||
select c, c.getText()
|
||||
@@ -1,2 +0,0 @@
|
||||
| tst.xml:2:1:5:8 | root | root | tst.xml | 0 | tst.xml:0:0:0:0 | tst.xml |
|
||||
| tst.xml:3:3:3:37 | child | child | root | 0 | tst.xml:0:0:0:0 | tst.xml |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLElement elt
|
||||
select elt, elt.getName(), elt.getParent(), elt.getIndex(), elt.getFile()
|
||||
@@ -1 +0,0 @@
|
||||
| tst.xml:3:3:3:37 | child | tst.xml:3:3:3:20 | foo=bar |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLElement e
|
||||
select e, e.getAnAttribute()
|
||||
@@ -1 +0,0 @@
|
||||
| tst.xml:0:0:0:0 | tst.xml |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLFile f
|
||||
select f
|
||||
@@ -1,5 +0,0 @@
|
||||
| tst.xml:2:1:5:8 | root |
|
||||
| tst.xml:3:3:3:20 | foo=bar |
|
||||
| tst.xml:3:3:3:37 | child |
|
||||
| tst.xml:3:20:3:29 | Some text |
|
||||
| tst.xml:4:3:4:21 | a comment |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLLocatable x
|
||||
select x
|
||||
@@ -1,2 +0,0 @@
|
||||
| root | 0 | tst.xml:3:3:3:37 | child |
|
||||
| tst.xml | 0 | tst.xml:2:1:5:8 | root |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLParent p, int i
|
||||
select p, i, p.getChild(i)
|
||||
@@ -1,3 +0,0 @@
|
||||
| child | Some text |
|
||||
| root | |
|
||||
| tst.xml | |
|
||||
@@ -1,4 +0,0 @@
|
||||
import javascript
|
||||
|
||||
from XMLParent p
|
||||
select p, p.getTextValue()
|
||||
24
javascript/ql/test/library-tests/XML/tests.expected
Normal file
24
javascript/ql/test/library-tests/XML/tests.expected
Normal file
@@ -0,0 +1,24 @@
|
||||
xmlAttribute
|
||||
| tst.xml:3:3:3:20 | foo=bar | tst.xml:3:3:3:37 | child | foo | bar |
|
||||
xmlComment
|
||||
| tst.xml:4:3:4:21 | a comment | a comment |
|
||||
xmlElement_getAnAttribute
|
||||
| tst.xml:3:3:3:37 | child | tst.xml:3:3:3:20 | foo=bar |
|
||||
xmlElement
|
||||
| tst.xml:2:1:5:8 | root | root | tst.xml | 0 | tst.xml:0:0:0:0 | tst.xml |
|
||||
| tst.xml:3:3:3:37 | child | child | root | 0 | tst.xml:0:0:0:0 | tst.xml |
|
||||
xmlFile
|
||||
| tst.xml:0:0:0:0 | tst.xml |
|
||||
xmlLocatable
|
||||
| tst.xml:2:1:5:8 | root |
|
||||
| tst.xml:3:3:3:20 | foo=bar |
|
||||
| tst.xml:3:3:3:37 | child |
|
||||
| tst.xml:3:20:3:29 | Some text |
|
||||
| tst.xml:4:3:4:21 | a comment |
|
||||
xmlParent_getChild
|
||||
| root | 0 | tst.xml:3:3:3:37 | child |
|
||||
| tst.xml | 0 | tst.xml:2:1:5:8 | root |
|
||||
xmlParent_getTextValue
|
||||
| child | Some text |
|
||||
| root | |
|
||||
| tst.xml | |
|
||||
28
javascript/ql/test/library-tests/XML/tests.ql
Normal file
28
javascript/ql/test/library-tests/XML/tests.ql
Normal file
@@ -0,0 +1,28 @@
|
||||
import javascript
|
||||
|
||||
query predicate xmlAttribute(XMLAttribute attr, XMLElement element, string name, string value) {
|
||||
attr.getElement() = element and
|
||||
attr.getName() = name and
|
||||
attr.getValue() = value
|
||||
}
|
||||
|
||||
query predicate xmlComment(XMLComment c, string text) { text = c.getText() }
|
||||
|
||||
query predicate xmlElement_getAnAttribute(XMLElement e, XMLAttribute attr) {
|
||||
attr = e.getAnAttribute()
|
||||
}
|
||||
|
||||
query predicate xmlElement(XMLElement elt, string name, XMLParent parent, int index, XMLFile file) {
|
||||
name = elt.getName() and
|
||||
parent = elt.getParent() and
|
||||
index = elt.getIndex() and
|
||||
file = elt.getFile()
|
||||
}
|
||||
|
||||
query predicate xmlFile(XMLFile f) { any() }
|
||||
|
||||
query predicate xmlLocatable(XMLLocatable x) { any() }
|
||||
|
||||
query predicate xmlParent_getChild(XMLParent p, int i, XMLElement child) { child = p.getChild(i) }
|
||||
|
||||
query predicate xmlParent_getTextValue(XMLParent p, string text) { p.getTextValue() = text }
|
||||
Reference in New Issue
Block a user