Skip to content
Closed

Subst 2 #22100

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions csharp/ql/integration-tests/windows/subst/code/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Program
{
static void Main() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions csharp/ql/integration-tests/windows/subst/code/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "9.0.201"
}
}
8 changes: 8 additions & 0 deletions csharp/ql/integration-tests/windows/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| code/Program.cs:0:0:0:0 | code/Program.cs | |
| code/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs:0:0:0:0 | code/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs | |
| code/obj/Debug/net9.0/dotnet_build.AssemblyInfo.cs:0:0:0:0 | code/obj/Debug/net9.0/dotnet_build.AssemblyInfo.cs | |
| code/obj/Debug/net9.0/dotnet_build.GlobalUsings.g.cs:0:0:0:0 | code/obj/Debug/net9.0/dotnet_build.GlobalUsings.g.cs | |
| code/obj/Debug/net9.0/dotnet_build.dll:0:0:0:0 | code/obj/Debug/net9.0/dotnet_build.dll | |
| file://:0:0:0:0 | | |
| file://Z:/dotnet_build.csproj:0:0:0:0 | Z:/dotnet_build.csproj | relative |
| file://Z:/obj/dotnet_build.csproj.nuget.g.props:0:0:0:0 | Z:/obj/dotnet_build.csproj.nuget.g.props | relative |
7 changes: 7 additions & 0 deletions csharp/ql/integration-tests/windows/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import csharp

from File f, string relative
where
not f.getURL().matches("file://C:/Program Files/%") and
if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions csharp/ql/integration-tests/windows/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import runs_on


@runs_on.windows
def test(codeql, csharp, cwd, subst_drive):
drive = subst_drive(cwd / "code")
codeql.database.create(source_root=drive)
3 changes: 3 additions & 0 deletions go/ql/integration-tests/subst/code/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

func main() {}
1 change: 1 addition & 0 deletions go/ql/integration-tests/subst/file.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| file://Z:/main.go:0:0:0:0 | Z:/main.go | relative |
5 changes: 5 additions & 0 deletions go/ql/integration-tests/subst/file.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import go

from File f, string relative
where if exists(f.getRelativePath()) then relative = "relative" else relative = ""
select f, relative
7 changes: 7 additions & 0 deletions go/ql/integration-tests/subst/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import