mirror of
https://github.com/github/codeql.git
synced 2026-07-04 19:15:29 +02:00
Add Windows integration tests showing that subst is handled inconsistently
This commit is contained in:
1
javascript/ql/integration-tests/subst/code/main.js
Normal file
1
javascript/ql/integration-tests/subst/code/main.js
Normal file
@@ -0,0 +1 @@
|
||||
function interesting() { }
|
||||
1
javascript/ql/integration-tests/subst/code/test.ts
Normal file
1
javascript/ql/integration-tests/subst/code/test.ts
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
javascript/ql/integration-tests/subst/file.expected
Normal file
2
javascript/ql/integration-tests/subst/file.expected
Normal file
@@ -0,0 +1,2 @@
|
||||
| file://Z:/main.js:0:0:0:0 | Z:/main.js | relative |
|
||||
| file://Z:/test.ts:0:0:0:0 | Z:/test.ts | relative |
|
||||
7
javascript/ql/integration-tests/subst/file.ql
Normal file
7
javascript/ql/integration-tests/subst/file.ql
Normal file
@@ -0,0 +1,7 @@
|
||||
import javascript
|
||||
|
||||
from File f, string relative
|
||||
where
|
||||
not f.getURL().matches("%/target/intree/%") and
|
||||
if exists(f.getRelativePath()) then relative = "relative" else relative = ""
|
||||
select f, relative
|
||||
7
javascript/ql/integration-tests/subst/test.py
Normal file
7
javascript/ql/integration-tests/subst/test.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import runs_on
|
||||
|
||||
|
||||
@runs_on.windows
|
||||
def test(codeql, javascript, cwd, subst_drive):
|
||||
drive = subst_drive(cwd / "code")
|
||||
codeql.database.create(source_root=drive)
|
||||
Reference in New Issue
Block a user