Skip to content

Commit

Permalink
[DRAFT]. Solve LeetCode #10 'Regular Expression Matching' [Hard].
Browse files Browse the repository at this point in the history
  • Loading branch information
eminencegrs committed Nov 11, 2024
1 parent 6361975 commit c559bb6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Text;

namespace LeetCode.Challenges.Problems0XX.P010_RegularExpressionMatching;

public static class Solution
{
public static bool IsMatch(string str, string pattern)
{
throw new NotImplementedException();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using FluentAssertions;
using LeetCode.Challenges.Problems0XX.P010_RegularExpressionMatching;
using Xunit;

namespace LeetCode.Challenges.UnitTests.Problems0XX.P010_RegularExpressionMatching;

public class SolutionTests
{
[Theory]
[MemberData(nameof(TestData))]
public void GivenStringAndPattern_WhenCallIsMatch_ThenResultAsExpected(
string str, string pattern, bool expectedResult)

Check warning on line 12 in LeetCode/tests/LeetCode.Challenges.UnitTests/Problems0XX/P010_RegularExpressionMatching/SolutionTests.cs

View workflow job for this annotation

GitHub Actions / build

Theory method 'GivenStringAndPattern_WhenCallIsMatch_ThenResultAsExpected' on test class 'SolutionTests' does not use parameter 'expectedResult'. Use the parameter, or remove the parameter and associated data. (https://xunit.net/xunit.analyzers/rules/xUnit1026)

Check warning on line 12 in LeetCode/tests/LeetCode.Challenges.UnitTests/Problems0XX/P010_RegularExpressionMatching/SolutionTests.cs

View workflow job for this annotation

GitHub Actions / build

Theory method 'GivenStringAndPattern_WhenCallIsMatch_ThenResultAsExpected' on test class 'SolutionTests' does not use parameter 'expectedResult'. Use the parameter, or remove the parameter and associated data. (https://xunit.net/xunit.analyzers/rules/xUnit1026)
{
var action = () => Solution.IsMatch(str, pattern);
action.Should().Throw<NotImplementedException>();
}

public static IEnumerable<object[]> TestData()
{
yield return ["aa", "a", false];
yield return ["aa", "a*", true];
yield return ["ab", ".*", true];
}
}

0 comments on commit c559bb6

Please sign in to comment.