feat(tests): implement a way to express that tests can fail

This commit is contained in:
rvcas
2023-05-25 16:54:53 -04:00
parent 65bf4a85e4
commit a124a16a61
12 changed files with 131 additions and 11 deletions

View File

@@ -115,6 +115,7 @@ pub fn lexer() -> impl Parser<char, Vec<(Token, Span)>, Error = ParseError> {
"todo" => Token::Todo,
"type" => Token::Type,
"when" => Token::When,
"fail" => Token::Fail,
"validator" => Token::Validator,
_ => {
if s.chars().next().map_or(false, |c| c.is_uppercase()) {

View File

@@ -80,6 +80,7 @@ pub enum Token {
When,
Trace,
Validator,
Fail,
}
impl fmt::Display for Token {
@@ -164,6 +165,7 @@ impl fmt::Display for Token {
Token::Test => "test",
Token::ErrorTerm => "error",
Token::Validator => "validator",
Token::Fail => "fail",
};
write!(f, "\"{s}\"")
}