#![allow(unused_imports)] #![allow(unused_variables)] #![allow(dead_code)] use rhai::Dynamic; use rhai::Engine; #[test] fn test_url_sanitization() { assert_eq!( sanitize_url_for_collection("https://docs.example.com/path"), "docs_example_com_path" ); assert_eq!( sanitize_url_for_collection("http://test.site:8080"), "test_site_8080" ); } #[test] fn test_use_website_syntax() { let mut engine = Engine::new(); assert!(engine .register_custom_syntax(&["USE_WEBSITE", "$expr$"], true, |_, _| Ok(Dynamic::UNIT)) .is_ok()); assert!(engine .register_custom_syntax(&["CLEAR_WEBSITES"], true, |_, _| Ok(Dynamic::UNIT)) .is_ok()); }