mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C#: Unit tests.
This commit is contained in:
@@ -33,6 +33,8 @@ namespace Semmle.Extraction.Tests
|
||||
FileExistsIn.Add(file);
|
||||
if (FileExists.TryGetValue(file, out var ret))
|
||||
return ret;
|
||||
if (FileExists.TryGetValue(System.IO.Path.GetFileName(file), out ret))
|
||||
return ret;
|
||||
throw new ArgumentException("Missing FileExists " + file);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Xunit;
|
||||
using Semmle.Util.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Semmle.Util;
|
||||
|
||||
namespace Semmle.Extraction.Tests
|
||||
{
|
||||
@@ -184,5 +186,24 @@ namespace Semmle.Extraction.Tests
|
||||
options = CSharp.Options.CreateWithEnvironment(new string[] {});
|
||||
Assert.True(options.Fast);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ArchiveArguments()
|
||||
{
|
||||
var file1 = Path.GetTempFileName();
|
||||
var file2 = Path.GetTempFileName();
|
||||
|
||||
try
|
||||
{
|
||||
File.AppendAllText(file1, "Test");
|
||||
new string[] { "/noconfig", "@" + file1 }.ArchiveCommandLine(file2);
|
||||
Assert.Equal("Test", File.ReadAllText(file2));
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(file1);
|
||||
File.Delete(file2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user