Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8bea6fa

Browse files
committed
C#: Unit tests.
1 parent 681953a commit 8bea6fa

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

csharp/extractor/Semmle.Autobuild.Tests/BuildScripts.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ bool IBuildActions.FileExists(string file)
3333
FileExistsIn.Add(file);
3434
if (FileExists.TryGetValue(file, out var ret))
3535
return ret;
36+
if (FileExists.TryGetValue(System.IO.Path.GetFileName(file), out ret))
37+
return ret;
3638
throw new ArgumentException("Missing FileExists " + file);
3739
}
3840

csharp/extractor/Semmle.Extraction.Tests/Options.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Xunit;
22
using Semmle.Util.Logging;
33
using System;
4+
using System.IO;
5+
using Semmle.Util;
46

57
namespace Semmle.Extraction.Tests
68
{
@@ -184,5 +186,24 @@ public void Fast()
184186
options = CSharp.Options.CreateWithEnvironment(new string[] {});
185187
Assert.True(options.Fast);
186188
}
189+
190+
[Fact]
191+
public void ArchiveArguments()
192+
{
193+
var file1 = Path.GetTempFileName();
194+
var file2 = Path.GetTempFileName();
195+
196+
try
197+
{
198+
File.AppendAllText(file1, "Test");
199+
new string[] { "/noconfig", "@" + file1 }.ArchiveCommandLine(file2);
200+
Assert.Equal("Test", File.ReadAllText(file2));
201+
}
202+
finally
203+
{
204+
File.Delete(file1);
205+
File.Delete(file2);
206+
}
207+
}
187208
}
188209
}

0 commit comments

Comments
 (0)