| 486 | |
| 487 | #[test] |
| 488 | fn test_hook_result_constructors() { |
| 489 | let cont = HookResult::continue_(); |
| 490 | assert!(cont.is_continue()); |
| 491 | assert!(!cont.is_block()); |
| 492 | |
| 493 | let cont_with = HookResult::continue_with(serde_json::json!({"key": "value"})); |
| 494 | assert!(cont_with.is_continue()); |
| 495 | |
| 496 | let block = HookResult::block("Blocked"); |
| 497 | assert!(block.is_block()); |
| 498 | assert!(!block.is_continue()); |
| 499 | |
| 500 | let retry = HookResult::retry(1000); |
| 501 | assert!(!retry.is_continue()); |
| 502 | assert!(!retry.is_block()); |
| 503 | |
| 504 | let skip = HookResult::skip(); |
| 505 | assert!(!skip.is_continue()); |
| 506 | assert!(!skip.is_block()); |
| 507 | } |
| 508 | |
| 509 | #[test] |
| 510 | fn test_engine_register_unregister() { |