JS: Add test

This commit is contained in:
Asger Feldthaus
2021-04-12 15:07:45 +01:00
parent 24de826133
commit d2fad180f8
12 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
| bad1.js:1:7:1:7 | Error: Unexpected token | Extraction failed in bad1.js with error Error: Unexpected token | 2 |
| bad2.ts:1:11:1:11 | Error: Expression expected. | Extraction failed in bad2.ts with error Error: Expression expected. | 2 |
| bad2.ts:1:13:1:13 | Error: Expression expected. | Extraction failed in bad2.ts with error Error: Expression expected. | 2 |
| bad3.html:2:11:2:11 | Error: Unexpected token | Extraction failed in bad3.html with error Error: Unexpected token | 2 |

View File

@@ -0,0 +1 @@
Diagnostics/ExtractionErrors.ql

View File

@@ -0,0 +1,4 @@
| contains-template.js:0:0:0:0 | contains-template.js | |
| good1.js:0:0:0:0 | good1.js | |
| good2.ts:0:0:0:0 | good2.ts | |
| good3.html:0:0:0:0 | good3.html | |

View File

@@ -0,0 +1 @@
Diagnostics/SuccessfullyExtractedFiles.ql

View File

@@ -0,0 +1 @@
let x x x;

View File

@@ -0,0 +1 @@
const z = ??;

View File

@@ -0,0 +1,3 @@
<script>
let q q q q ; // error
</script>

View File

@@ -0,0 +1,4 @@
const obj = {
// Template where we can't parse `x x x` but surrounding file still OK
template: '<b [foo]="x x x"></a>'
};

View File

@@ -0,0 +1 @@
let x = 123;

View File

@@ -0,0 +1 @@
const y: string = "dfg";

View File

@@ -0,0 +1,3 @@
<script>
let qwe = 123;
</script>

View File

@@ -0,0 +1 @@
semmle-extractor-options: --tolerate-parse-errors --experimental