aggregate the tests in library-tests/HTML/HTMLElementAndHTMLAttribute into a single .ql file

This commit is contained in:
Erik Krogh Kristensen
2020-10-20 13:15:11 +02:00
parent 003854ebe7
commit b43e21a4c7
12 changed files with 51 additions and 45 deletions

View File

@@ -1,3 +0,0 @@
| tst.html:5:17:5:33 | src=external.js | tst.html:5:9:5:43 | <script>...</> | src | external.js |
| tst.html:10:11:10:16 | ng-app= | tst.html:10:5:12:11 | <body>...</> | ng-app | |
| tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) | tst.html:11:9:11:64 | <a>...</> | href | javascript:void(alert('Nope!')) |

View File

@@ -1,4 +0,0 @@
import javascript
from HTML::Attribute a
select a, a.getElement(), a.getName(), a.getValue()

View File

@@ -1,3 +0,0 @@
| tst.html:5:9:5:43 | <script>...</> | 0 | tst.html:5:17:5:33 | src=external.js |
| tst.html:10:5:12:11 | <body>...</> | 0 | tst.html:10:11:10:16 | ng-app= |
| tst.html:11:9:11:64 | <a>...</> | 0 | tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) |

View File

@@ -1,4 +0,0 @@
import javascript
from HTML::Element elt, int i
select elt, i, elt.getAttribute(i)

View File

@@ -1,6 +0,0 @@
| tst.html:2:1:13:7 | <html>...</> | 1 | tst.html:3:5:9:11 | <head>...</> |
| tst.html:2:1:13:7 | <html>...</> | 3 | tst.html:10:5:12:11 | <body>...</> |
| tst.html:3:5:9:11 | <head>...</> | 1 | tst.html:4:9:4:32 | <title>...</> |
| tst.html:3:5:9:11 | <head>...</> | 3 | tst.html:5:9:5:43 | <script>...</> |
| tst.html:3:5:9:11 | <head>...</> | 5 | tst.html:6:9:8:17 | <script>...</> |
| tst.html:10:5:12:11 | <body>...</> | 1 | tst.html:11:9:11:64 | <a>...</> |

View File

@@ -1,4 +0,0 @@
import javascript
from HTML::Element elt, int i
select elt, i, elt.getChild(i)

View File

@@ -1,7 +0,0 @@
| tst.html:2:1:13:7 | <html>...</> | html |
| tst.html:3:5:9:11 | <head>...</> | head |
| tst.html:4:9:4:32 | <title>...</> | title |
| tst.html:5:9:5:43 | <script>...</> | script |
| tst.html:6:9:8:17 | <script>...</> | script |
| tst.html:10:5:12:11 | <body>...</> | body |
| tst.html:11:9:11:64 | <a>...</> | a |

View File

@@ -1,4 +0,0 @@
import javascript
from HTML::Element elt
select elt, elt.getName()

View File

@@ -1,6 +0,0 @@
| tst.html:3:5:9:11 | <head>...</> | tst.html:2:1:13:7 | <html>...</> |
| tst.html:4:9:4:32 | <title>...</> | tst.html:3:5:9:11 | <head>...</> |
| tst.html:5:9:5:43 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
| tst.html:6:9:8:17 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
| tst.html:10:5:12:11 | <body>...</> | tst.html:2:1:13:7 | <html>...</> |
| tst.html:11:9:11:64 | <a>...</> | tst.html:10:5:12:11 | <body>...</> |

View File

@@ -1,4 +0,0 @@
import javascript
from HTML::Element elt
select elt, elt.getParent()

View File

@@ -0,0 +1,30 @@
htmlAttribute
| tst.html:5:17:5:33 | src=external.js | tst.html:5:9:5:43 | <script>...</> | src | external.js |
| tst.html:10:11:10:16 | ng-app= | tst.html:10:5:12:11 | <body>...</> | ng-app | |
| tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) | tst.html:11:9:11:64 | <a>...</> | href | javascript:void(alert('Nope!')) |
htmlElement_getAttribute
| tst.html:5:9:5:43 | <script>...</> | 0 | tst.html:5:17:5:33 | src=external.js |
| tst.html:10:5:12:11 | <body>...</> | 0 | tst.html:10:11:10:16 | ng-app= |
| tst.html:11:9:11:64 | <a>...</> | 0 | tst.html:11:12:11:49 | href=javascript:void(alert('Nope!')) |
htmlElement_getChild
| tst.html:2:1:13:7 | <html>...</> | 1 | tst.html:3:5:9:11 | <head>...</> |
| tst.html:2:1:13:7 | <html>...</> | 3 | tst.html:10:5:12:11 | <body>...</> |
| tst.html:3:5:9:11 | <head>...</> | 1 | tst.html:4:9:4:32 | <title>...</> |
| tst.html:3:5:9:11 | <head>...</> | 3 | tst.html:5:9:5:43 | <script>...</> |
| tst.html:3:5:9:11 | <head>...</> | 5 | tst.html:6:9:8:17 | <script>...</> |
| tst.html:10:5:12:11 | <body>...</> | 1 | tst.html:11:9:11:64 | <a>...</> |
htmlElement_getName
| tst.html:2:1:13:7 | <html>...</> | html |
| tst.html:3:5:9:11 | <head>...</> | head |
| tst.html:4:9:4:32 | <title>...</> | title |
| tst.html:5:9:5:43 | <script>...</> | script |
| tst.html:6:9:8:17 | <script>...</> | script |
| tst.html:10:5:12:11 | <body>...</> | body |
| tst.html:11:9:11:64 | <a>...</> | a |
htmlElement_getParent
| tst.html:3:5:9:11 | <head>...</> | tst.html:2:1:13:7 | <html>...</> |
| tst.html:4:9:4:32 | <title>...</> | tst.html:3:5:9:11 | <head>...</> |
| tst.html:5:9:5:43 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
| tst.html:6:9:8:17 | <script>...</> | tst.html:3:5:9:11 | <head>...</> |
| tst.html:10:5:12:11 | <body>...</> | tst.html:2:1:13:7 | <html>...</> |
| tst.html:11:9:11:64 | <a>...</> | tst.html:10:5:12:11 | <body>...</> |

View File

@@ -0,0 +1,21 @@
import javascript
query predicate htmlAttribute(HTML::Attribute a, HTML::Element e, string name, string val) {
e = a.getElement() and
name = a.getName() and
val = a.getValue()
}
query predicate htmlElement_getAttribute(HTML::Element elt, int i, HTML::Attribute attr) {
elt.getAttribute(i) = attr
}
query predicate htmlElement_getChild(HTML::Element elt, int i, HTML::Element child) {
elt.getChild(i) = child
}
query predicate htmlElement_getName(HTML::Element elt, string name) { name = elt.getName() }
query predicate htmlElement_getParent(HTML::Element elt, HTML::Element parent) {
parent = elt.getParent()
}