public Property Valid_token_sequence_lexes_back_to_itself() { return(Prop.ForAll(Arbitrary.PsuedoTokenList(), tokens => { var input = string.Concat(tokens.Select(t => t.Text)); var result = Lex(input); var outputAsPsuedoTokens = result.ToPsuedoTokens(); var expectedPsuedoTokens = tokens.Append(PsuedoToken.EndOfFile()).ToFixedList(); return expectedPsuedoTokens.SequenceEqual(outputAsPsuedoTokens) .Label($"Text: „{input.Escape()}„") .Label($"Actual: {outputAsPsuedoTokens.DebugFormat()}") .Label($"Expected: {expectedPsuedoTokens.DebugFormat()}"); })); }