feat: enable Char blocks again, refs NOISSUE
This commit is contained in:
@@ -34,6 +34,7 @@ public class TextParserTests
|
||||
bca
|
||||
cab";
|
||||
private const string testInput11 = @"2 x y 4 x y 6 x y 4 x y 1 x y";
|
||||
private const string testInput12 = @"abcd";
|
||||
|
||||
[Fact]
|
||||
public void LineParser_TestSimpleRepetition()
|
||||
@@ -443,4 +444,27 @@ public class TextParserTests
|
||||
Assert.Equal(4, numbers[3]);
|
||||
Assert.Equal(1, numbers[4]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TextParser_TestCharExplicit()
|
||||
{
|
||||
var schemaBuilder = new InputSchemaBuilder();
|
||||
var schema = schemaBuilder
|
||||
.Repeat()
|
||||
.Expect(InputType.Char)
|
||||
.EndRepetition()
|
||||
.Build();
|
||||
|
||||
var parser = new TextParser<InputSchemaContext>(schema);
|
||||
var numbers = parser
|
||||
.SetInputText(testInput12)
|
||||
.Parse()
|
||||
.AsSingleStream<string>();
|
||||
|
||||
Assert.Equal(4, numbers.Count);
|
||||
Assert.Equal("a", numbers[0]);
|
||||
Assert.Equal("b", numbers[1]);
|
||||
Assert.Equal("c", numbers[2]);
|
||||
Assert.Equal("d", numbers[3]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user