我正在使用 'Token()' 方法来丢弃前导和尾随空格,但它不会,此测试失败并显示消息
Expected string to be "token", but it has unexpected whitespace at the end.
我试图在方法Token()
之前调用方法,Text()
但它也无济于事。
Parse.AnyChar.Many().Token().Text()
如何Token()
正确使用方法?
[Test]
public void Test()
{
Parser<string> parser = Parse.AnyChar.Many().Text().Token();
var actual = parser.Parse(" token ");
actual.Should().Be("token"); // without leading and trailing whitespaces
}