fix: remove duplicate TokenConverter definition, ref: NOISSUE

This commit is contained in:
2024-12-13 13:50:01 +01:00
parent cc0f0a24d9
commit 2067fe06fc
2 changed files with 29 additions and 227 deletions

View File

@@ -33,6 +33,7 @@ public class TextParserTests
private const string testInput10 = @"abc
bca
cab";
private const string testInput11 = @"2 x y 4 x y 6 x y 4 x y 1 x y";
[Fact]
public void LineParser_TestSimpleRepetition()
@@ -394,7 +395,7 @@ public class TextParserTests
}
[Fact]
public void TextPArser_TestReadingChars()
public void TextParser_TestReadingChars()
{
var schemaBuilder = new InputSchemaBuilder();
var schema = schemaBuilder
@@ -415,4 +416,31 @@ public class TextParserTests
Assert.Equal(3, row[1].Count);
Assert.Equal(3, row[2].Count);
}
[Fact]
public void TextParser_TestFilter()
{
var schemaBuilder = new InputSchemaBuilder();
var schema = schemaBuilder
.Repeat()
.Expect(InputType.Integer)
.Expect(InputType.Char)
.Expect(InputType.Char)
.EndRepetition()
.Build();
var parser = new TextParser<InputSchemaContext>(schema);
var numbers = parser
.SetInputText(testInput11)
.Parse()
.Filter(InputType.Integer)
.AsSingleStream<int>();
Assert.Equal(5, numbers.Count);
Assert.Equal(2, numbers[0]);
Assert.Equal(4, numbers[1]);
Assert.Equal(6, numbers[2]);
Assert.Equal(4, numbers[3]);
Assert.Equal(1, numbers[4]);
}
}