This commit is contained in:
Tamas Vajk 2024-08-12 15:49:09 +02:00
Родитель 089999dd3c
Коммит bfaafcf88c
2 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -189,13 +189,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
/// (together with used package information) required for compilation.
/// </summary>
/// <returns>True if parsing succeeds, otherwise false.</returns>
public bool TryParse(string json, string? jsonPath = null)
public bool TryParse(string json, string jsonPath)
{
try
{
var obj = JObject.Parse(json);
AddPackageDependencies(obj, jsonPath ?? json);
AddFrameworkDependencies(obj, jsonPath ?? json);
AddPackageDependencies(obj, jsonPath);
AddFrameworkDependencies(obj, jsonPath);
return true;
}
catch (Exception e)

Просмотреть файл

@ -16,7 +16,7 @@ namespace Semmle.Extraction.Tests
var json = assetsJson1;
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.True(success);
@ -46,7 +46,7 @@ namespace Semmle.Extraction.Tests
var json = "garbage data";
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.False(success);
@ -61,7 +61,7 @@ namespace Semmle.Extraction.Tests
var json = assetsNet70;
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.True(success);
@ -91,7 +91,7 @@ namespace Semmle.Extraction.Tests
var json = assetsNet48;
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.True(success);
@ -117,7 +117,7 @@ namespace Semmle.Extraction.Tests
var json = assetsNetstandard21;
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.True(success);
@ -144,7 +144,7 @@ namespace Semmle.Extraction.Tests
var json = assetsNetstandard16;
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.True(success);
@ -175,7 +175,7 @@ namespace Semmle.Extraction.Tests
var json = assetsNetcoreapp20;
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.True(success);
@ -202,7 +202,7 @@ namespace Semmle.Extraction.Tests
var json = assetsNetcoreapp31;
// Execute
var success = assets.TryParse(json);
var success = assets.TryParse(json, "");
// Verify
Assert.True(success);