Skip to content

Commit

Permalink
[#132] ParsingError 테스트코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
myyrakle committed Jul 23, 2024
1 parent 4b32768 commit dab9965
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/errors/parsing_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,22 @@ impl std::fmt::Display for ParsingError {
write!(formatter, "parsing error: {}", self.message)
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_parsing_error_eq() {
let error1 = ParsingError::wrap("test");
let error2 = ParsingError::wrap("test");
assert_eq!(error1, error2);
}

#[test]
fn test_parsing_error_display() {
let error = ParsingError::wrap("test");

assert!(error.to_string().contains("parsing error: test"));
}
}

0 comments on commit dab9965

Please sign in to comment.