Remove unnecessary tests from the lua profiles

This commit is contained in:
Pieter Vander Vennet 2020-10-15 20:27:51 +02:00
parent 3fb6c0f83e
commit 3f3940a7b3
2 changed files with 11 additions and 0 deletions

View file

@ -36,6 +36,11 @@ namespace AspectedRouting.IO.LuaSkeleton
{
return _functionImplementations;
}
public bool ContainsFunction(string name)
{
return _alreadyAddedFunctions.Contains(name);
}
public void AddDependenciesFor(IExpression e)
{

View file

@ -103,6 +103,12 @@ namespace AspectedRouting.IO.itinero1
private string GenerateAspectTestSuite(AspectTestSuite testSuite)
{
var fName = testSuite.FunctionToApply.Name;
if (!_skeleton.ContainsFunction(fName))
{
return "";
}
var tests =
testSuite.Tests
.Select((test, i) => GenerateAspectUnitTestCall(fName, i, test.expected, test.tags))