コード例 #1
0
 public Property Token_lexes()
 {
     return(Prop.ForAll(Arbitrary.PsuedoToken(), token =>
     {
         var result = Lex(token.Text);
         var outputAsPsuedoTokens = result.ToPsuedoTokens();
         var expectedPsuedoTokens = token.Yield().Append(PsuedoToken.EndOfFile()).ToList();
         return expectedPsuedoTokens.SequenceEqual(outputAsPsuedoTokens)
         .Label($"Actual:   {outputAsPsuedoTokens.DebugFormat()}")
         .Label($"Expected: {expectedPsuedoTokens.DebugFormat()}")
         .Collect(token.TokenType.Name);
     }));
 }