Skip to content

Commit 26f9297

Browse files
committed
C#: Convert source capture test to inline expectation.
1 parent 404b39b commit 26f9297

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
| Sources;NewSources;false;WrapConsoleReadKey;();;ReturnValue;local;df-generated |
2-
| Sources;NewSources;false;WrapConsoleReadLine;();;ReturnValue;local;df-generated |
3-
| Sources;NewSources;false;WrapConsoleReadLineAndProcees;(System.String);;ReturnValue;local;df-generated |
1+
unexpectedModel
2+
expectedModel
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import csharp
2+
import utils.modelgenerator.internal.CaptureModels
3+
import TestUtilities.InlineMadTest
4+
5+
module InlineMadTestConfig implements InlineMadTestConfigSig {
6+
string getCapturedModel(Callable c) { result = captureSource(c) }
7+
8+
string getKind() { result = "source" }
9+
}
10+
11+
import InlineMadTest<InlineMadTestConfig>

csharp/ql/test/utils/modelgenerator/dataflow/CaptureSourceModels.qlref

Lines changed: 0 additions & 1 deletion
This file was deleted.

csharp/ql/test/utils/modelgenerator/dataflow/Sources.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ namespace Sources;
55
public class NewSources
66
{
77
// New source
8+
// source=Sources;NewSources;false;WrapConsoleReadLine;();;ReturnValue;local;df-generated
89
public string? WrapConsoleReadLine()
910
{
1011
return Console.ReadLine();
1112
}
1213

1314
// New source
15+
// source=Sources;NewSources;false;WrapConsoleReadLineAndProcees;(System.String);;ReturnValue;local;df-generated
1416
public string WrapConsoleReadLineAndProcees(string prompt)
1517
{
1618
var s = Console.ReadLine();
@@ -24,8 +26,9 @@ public string WrapConsoleReadLineAndProcees(string prompt)
2426
}
2527

2628
// New source
29+
// source=Sources;NewSources;false;WrapConsoleReadKey;();;ReturnValue;local;df-generated
2730
public ConsoleKeyInfo WrapConsoleReadKey()
2831
{
2932
return Console.ReadKey();
3033
}
31-
}
34+
}

0 commit comments

Comments
 (0)