feat: enable Char blocks again, refs NOISSUE

This commit is contained in:
Simon Diesenreiter
2025-12-01 14:04:50 +01:00
parent 1d68b70fa5
commit 8475389b99
4 changed files with 50 additions and 1 deletions

View File

@@ -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]);
}
}