git-next/crates/config/src/webhook/tests.rs
Paul Campbell ea20afee12
Some checks failed
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
Rust / build (push) Has been cancelled
refactor: config: use newtype
2024-06-19 08:16:54 +01:00

25 lines
550 B
Rust

mod auth {
use crate::WebhookAuth;
#[test]
fn bytes() -> Result<(), Box<dyn std::error::Error>> {
let ulid = ulid::Ulid::new();
let wa = WebhookAuth::try_new(ulid.to_string().as_str())?;
assert_eq!(ulid.to_bytes(), wa.to_bytes());
Ok(())
}
#[test]
fn string() -> Result<(), Box<dyn std::error::Error>> {
let ulid = ulid::Ulid::new();
let wa = WebhookAuth::try_new(ulid.to_string().as_str())?;
assert_eq!(ulid.to_string(), wa.to_string());
Ok(())
}
}