fix: Using covariant interface for IParser and IParseResult.
Rename CanonSharp.Common to CanonSharp.Pascal.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using CanonSharp.Combinator.Abstractions;
|
||||
using CanonSharp.Combinator.Extensions;
|
||||
using CanonSharp.Combinator.Text;
|
||||
using CanonSharp.Common.Scanner;
|
||||
using CanonSharp.Pascal.Scanner;
|
||||
using CanonSharp.Tests.Utils;
|
||||
using static CanonSharp.Combinator.Text.TextParserBuilder;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class TextParserTests : ParserTestsBase
|
||||
[InlineData('d', "d")]
|
||||
public void OneOfTest(char except, string input)
|
||||
{
|
||||
Parser<char, char> parser = OneOf("abcd");
|
||||
IParser<char, char> parser = OneOf("abcd");
|
||||
ValidateSuccessfulResult(parser, except, input);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TextParserTests : ParserTestsBase
|
||||
[InlineData('D', "D")]
|
||||
public void OneOfIgnoreCaseTest(char except, string input)
|
||||
{
|
||||
Parser<char, char> parser = OneOfIgnoreCase("abcd");
|
||||
IParser<char, char> parser = OneOfIgnoreCase("abcd");
|
||||
ValidateSuccessfulResult(parser, except, input);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class TextParserTests : ParserTestsBase
|
||||
[InlineData("Hello,World.")]
|
||||
public void StringIgnoreCaseTest(string literalValue)
|
||||
{
|
||||
Parser<char, string> parser = StringIgnoreCase("hello,world.");
|
||||
IParser<char, string> parser = StringIgnoreCase("hello,world.");
|
||||
ValidateSuccessfulResult(parser, literalValue, literalValue);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class TextParserTests : ParserTestsBase
|
||||
[InlineData('9')]
|
||||
public void RangeTest(char except)
|
||||
{
|
||||
Parser<char, char> parser = Range('0', '9');
|
||||
IParser<char, char> parser = Range('0', '9');
|
||||
ValidateSuccessfulResult(parser, except, except.ToString());
|
||||
|
||||
ValidateFailedResult(parser, "abc");
|
||||
@@ -161,8 +161,8 @@ public class TextParserTests : ParserTestsBase
|
||||
test
|
||||
""");
|
||||
|
||||
Parser<char, IEnumerable<string>> parser = StringIgnoreCase("test").SkipSpaceAndLineBreak().Many();
|
||||
ParseResult<char, IEnumerable<string>> result = parser.Parse(state);
|
||||
IParser<char, IEnumerable<string>> parser = StringIgnoreCase("test").SkipSpaceAndLineBreak().Many();
|
||||
IParseResult<char, IEnumerable<string>> result = parser.Parse(state);
|
||||
|
||||
Assert.All(result.Value, x => Assert.Equal("test", x.ToLower()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user