linting and fmt
This commit is contained in:
@@ -57,7 +57,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
log::error!("Failed to read script file '{}': {}", script_path_str, e);
|
||||
// Attempt to read from an alternative path if run via `cargo run --example`
|
||||
// where current dir might be the crate root.
|
||||
let alt_script_path = Path::new(file!()).parent().unwrap().join("auth_script.rhai");
|
||||
let alt_script_path = Path::new(file!())
|
||||
.parent()
|
||||
.unwrap()
|
||||
.join("auth_script.rhai");
|
||||
log::info!("Attempting alternative script path: {:?}", alt_script_path);
|
||||
fs::read_to_string(&alt_script_path)?
|
||||
}
|
||||
@@ -106,9 +109,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
);
|
||||
// Basic assertion for expected output
|
||||
if caller_pk == "admin_pk" {
|
||||
assert_eq!(details.output, Some("Access Granted: Welcome Admin!".to_string()));
|
||||
assert_eq!(
|
||||
details.output,
|
||||
Some("Access Granted: Welcome Admin!".to_string())
|
||||
);
|
||||
} else if caller_pk == "user_pk" {
|
||||
assert_eq!(details.output, Some("Limited Access: Welcome User!".to_string()));
|
||||
assert_eq!(
|
||||
details.output,
|
||||
Some("Limited Access: Welcome User!".to_string())
|
||||
);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
|
Reference in New Issue
Block a user