Skip to content

Commit

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

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

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

#[test]
fn test_into_error_display() {
let error = IntoError::wrap("test");

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

0 comments on commit ded6230

Please sign in to comment.