mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
C#: Convert source capture test to inline expectation.
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
| Sources;NewSources;false;WrapConsoleReadKey;();;ReturnValue;local;df-generated |
|
||||
| Sources;NewSources;false;WrapConsoleReadLine;();;ReturnValue;local;df-generated |
|
||||
| Sources;NewSources;false;WrapConsoleReadLineAndProcees;(System.String);;ReturnValue;local;df-generated |
|
||||
unexpectedModel
|
||||
expectedModel
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import csharp
|
||||
import utils.modelgenerator.internal.CaptureModels
|
||||
import TestUtilities.InlineMadTest
|
||||
|
||||
module InlineMadTestConfig implements InlineMadTestConfigSig {
|
||||
string getCapturedModel(Callable c) { result = captureSource(c) }
|
||||
|
||||
string getKind() { result = "source" }
|
||||
}
|
||||
|
||||
import InlineMadTest<InlineMadTestConfig>
|
||||
@@ -1 +0,0 @@
|
||||
utils/modelgenerator/CaptureSourceModels.ql
|
||||
@@ -5,12 +5,14 @@ namespace Sources;
|
||||
public class NewSources
|
||||
{
|
||||
// New source
|
||||
// source=Sources;NewSources;false;WrapConsoleReadLine;();;ReturnValue;local;df-generated
|
||||
public string? WrapConsoleReadLine()
|
||||
{
|
||||
return Console.ReadLine();
|
||||
}
|
||||
|
||||
// New source
|
||||
// source=Sources;NewSources;false;WrapConsoleReadLineAndProcees;(System.String);;ReturnValue;local;df-generated
|
||||
public string WrapConsoleReadLineAndProcees(string prompt)
|
||||
{
|
||||
var s = Console.ReadLine();
|
||||
@@ -24,8 +26,9 @@ public class NewSources
|
||||
}
|
||||
|
||||
// New source
|
||||
// source=Sources;NewSources;false;WrapConsoleReadKey;();;ReturnValue;local;df-generated
|
||||
public ConsoleKeyInfo WrapConsoleReadKey()
|
||||
{
|
||||
return Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user