Skip to content

Commit

Permalink
feat(Mutator): Add mutator for GeneratedRegex
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentiva committed Nov 11, 2024
1 parent 72172de commit 58ce90f
Show file tree
Hide file tree
Showing 38 changed files with 2,404 additions and 47 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,5 @@ StrykerLogs/
*.DotSettings
/src/Stryker.CLI/TestStatisticsAnalyzer/test-stats-report.json
.DS_Store

*.received.*
1 change: 1 addition & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PackageVersion Include="NuGet.Protocol" Version="6.11.1" />
<PackageVersion Include="ResXResourceReader.NetStandard" Version="1.3.0" />
<PackageVersion Include="YamlDotNet" Version="16.2.0" />
<PackageVersion Include="Verify.MSTest" Version="26.6.0" />
<PackageVersion Include="Grynwald.MarkdownGenerator" Version="3.0.106" />
<PackageVersion Include="LibGit2Sharp" Version="0.30.0" />
<PackageVersion Include="FSharp.Compiler.Service" Version="42.7.100-preview.22427.1" />
Expand Down
3 changes: 3 additions & 0 deletions src/Stryker.Abstractions/IReadOnlyMutant.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Stryker.Abstractions.TestRunners;
using Stryker.Abstractions.Mutants;
using Microsoft.CodeAnalysis;

namespace Stryker.Abstractions;

Expand All @@ -17,4 +18,6 @@ public interface IReadOnlyMutant
ITestGuids AssessingTests { get; }
bool CountForStats { get; }
bool IsStaticValue { get; }
string ReplacementText => Mutation.ReplacementNode.ToString();
FileLinePositionSpan OriginalLocation => Mutation.OriginalNode.GetLocation().GetMappedLineSpan();
}
5 changes: 5 additions & 0 deletions src/Stryker.Abstractions/Mutation.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Microsoft.CodeAnalysis;
using Stryker.Abstractions.Mutators;

Expand All @@ -13,4 +14,8 @@ public class Mutation
public string DisplayName { get; set; }

Check warning on line 14 in src/Stryker.Abstractions/Mutation.cs

View workflow job for this annotation

GitHub Actions / integration-test

Non-nullable property 'DisplayName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 14 in src/Stryker.Abstractions/Mutation.cs

View workflow job for this annotation

GitHub Actions / integration-test

Non-nullable property 'DisplayName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public Mutator Type { get; set; }
public string Description { get; set; }

Check warning on line 16 in src/Stryker.Abstractions/Mutation.cs

View workflow job for this annotation

GitHub Actions / integration-test

Non-nullable property 'Description' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

public string? ReplacementText { get; set; }

public FileLinePositionSpan? OriginalLocation { get; set; }
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Text.RegularExpressions;
namespace StrykerNet.UnitTest.Mutants.TestResources;
public partial class R {
private static Regex AbcGeneratedRegex() => (StrykerNamespace.MutantControl.IsActive(13)?AbcGeneratedRegex_RegexQuantifierRemovalMutation_uJA6aLkSDZf1nNEqTTrmUwkVMpUC():(StrykerNamespace.MutantControl.IsActive(12)?AbcGeneratedRegex_RegexPredefinedCharacterClassToCharacterClassWithItsNegationChange_MDzkRwclKiIgJcKRendsP7fvRxsC():(StrykerNamespace.MutantControl.IsActive(11)?AbcGeneratedRegex_RegexPredefinedCharacterClassNullification_zvabPNkNXi5E4WVy9DbXSDBtJBcC():(StrykerNamespace.MutantControl.IsActive(10)?AbcGeneratedRegex_RegexGreedyQuantifierToReluctantQuantifierModification_w4583iXfF3f5E1wYY0vUHvf89GsC():(StrykerNamespace.MutantControl.IsActive(9)?AbcGeneratedRegex_RegexGreedyQuantifierQuantityMutation_SxSBojTcWfK90GNEzOYCcKxKPEMC():(StrykerNamespace.MutantControl.IsActive(8)?AbcGeneratedRegex_RegexGreedyQuantifierQuantityMutation_EemMBA83KH5r9vsxwuYTbZItICIC():(StrykerNamespace.MutantControl.IsActive(7)?AbcGeneratedRegex_RegexGreedyQuantifierQuantityMutation_0IPy0NkuaZuus5vyaBNObDf8YBEC():(StrykerNamespace.MutantControl.IsActive(6)?AbcGeneratedRegex_RegexCharacterClassToAnycharChange_ChZb0RJfdWiCoO7uZWgXV9GKRWoC():(StrykerNamespace.MutantControl.IsActive(5)?AbcGeneratedRegex_RegexCharacterClassShorthandNegationMutation_MlYZgMyXCSRTuWJOS9wBgXbB5tcC():(StrykerNamespace.MutantControl.IsActive(4)?AbcGeneratedRegex_RegexCharacterClassNegationMutation_sUNdnI9ukFndVf8l6TkBoumJJRQC():(StrykerNamespace.MutantControl.IsActive(3)?AbcGeneratedRegex_RegexCharacterClassChildRemoval_yxJAlmw5XA356qagdqMKq3btNCEC():(StrykerNamespace.MutantControl.IsActive(2)?AbcGeneratedRegex_RegexCharacterClassChildRemoval_e4iNMNHMRl5IY1AYBopi97YjMQwC():(StrykerNamespace.MutantControl.IsActive(1)?AbcGeneratedRegex_RegexCharacterClassChildRemoval_5XPHLFUGLBs4SAQEaHNXnV9D4MkC():(StrykerNamespace.MutantControl.IsActive(0)?AbcGeneratedRegex_RegexAnchorRemovalMutation_SdtdlVHq9QAJyltvbdr0AfzHrW4C():AbcGeneratedRegex_Original()))))))))))))));
[GeneratedRegex(@"^[abc]\d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_Original();
[GeneratedRegex("[abc]\\d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexAnchorRemovalMutation_SdtdlVHq9QAJyltvbdr0AfzHrW4C();
[GeneratedRegex("^[ab]\\d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexCharacterClassChildRemoval_5XPHLFUGLBs4SAQEaHNXnV9D4MkC();
[GeneratedRegex("^[ac]\\d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexCharacterClassChildRemoval_e4iNMNHMRl5IY1AYBopi97YjMQwC();
[GeneratedRegex("^[bc]\\d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexCharacterClassChildRemoval_yxJAlmw5XA356qagdqMKq3btNCEC();
[GeneratedRegex("^[^abc]\\d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexCharacterClassNegationMutation_sUNdnI9ukFndVf8l6TkBoumJJRQC();
[GeneratedRegex("^[abc]\\D?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexCharacterClassShorthandNegationMutation_MlYZgMyXCSRTuWJOS9wBgXbB5tcC();
[GeneratedRegex("^[\\w\\W]\\d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexCharacterClassToAnycharChange_ChZb0RJfdWiCoO7uZWgXV9GKRWoC();
[GeneratedRegex("^[abc]\\d{0,0}", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexGreedyQuantifierQuantityMutation_0IPy0NkuaZuus5vyaBNObDf8YBEC();
[GeneratedRegex("^[abc]\\d{0,2}", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexGreedyQuantifierQuantityMutation_EemMBA83KH5r9vsxwuYTbZItICIC();
[GeneratedRegex("^[abc]\\d{1,1}", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexGreedyQuantifierQuantityMutation_SxSBojTcWfK90GNEzOYCcKxKPEMC();
[GeneratedRegex("^[abc]\\d??", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexGreedyQuantifierToReluctantQuantifierModification_w4583iXfF3f5E1wYY0vUHvf89GsC();
[GeneratedRegex("^[abc]d?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexPredefinedCharacterClassNullification_zvabPNkNXi5E4WVy9DbXSDBtJBcC();
[GeneratedRegex("^[abc][\\d\\D]?", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexPredefinedCharacterClassToCharacterClassWithItsNegationChange_MDzkRwclKiIgJcKRendsP7fvRxsC();
[GeneratedRegex("^[abc]\\d", RegexOptions.IgnoreCase, "en-US")]
private static partial Regex AbcGeneratedRegex_RegexQuantifierRemovalMutation_uJA6aLkSDZf1nNEqTTrmUwkVMpUC();
}
Loading

0 comments on commit 58ce90f

Please sign in to comment.