Skip to content

Commit

Permalink
#57 - тест на проверку подстановки
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepami committed Aug 3, 2024
1 parent 8a42fd7 commit ff6b42d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace HydraScript.Infrastructure;
internal partial class {info.ClassName}
{{
[StringSyntax(StringSyntaxAttribute.Regex)]
private const string Pattern =
public const string Pattern =
""""""
{pattern}
"""""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace HydraScript.Infrastructure;
internal partial class TestPatternContainer
{
[StringSyntax(StringSyntaxAttribute.Regex)]
private const string Pattern =
public const string Pattern =
"""
(?<Word>[a-zA-Z]+)|(?<Number>[0-9]+)|(?<ERROR>\S+)
""";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using HydraScript.Infrastructure;
using Xunit;

namespace HydraScript.Tests.Unit.Infrastructure;

public class GeneratedRegexContainerTests
{
[Fact]
public void GetRegex_Generated_ManualIsUpToDate() =>
GeneratedRegexContainer.Pattern.Trim().Should().Be(
GeneratedRegexContainer.GetRegex().ToString(),
"because В атрибут GeneratedRegex не подставлена актуальная сгенерированная регулярка");
}

0 comments on commit ff6b42d

Please sign in to comment.