refactor to work as a lib

This commit is contained in:
2025-12-28 11:48:07 +00:00
parent 9376127980
commit 6bc01b63ca
9 changed files with 82 additions and 47 deletions

20
tests/test_config.rs Normal file
View File

@@ -0,0 +1,20 @@
use dns_config;
#[test]
fn test_config() {
let zone_data =
dns_config::ServerZonesConnection::get_config(&"config_template.toml".to_string()).unwrap();
assert_eq!(zone_data.root_domain, "root.domain.example");
assert_eq!(
zone_data.servers_data.get(1).unwrap().conection_str,
"udp://192.168.1.1:53"
);
assert_eq!(
zone_data.servers_data.get(0).unwrap().key,
"key 0 in base64"
);
assert_eq!(
zone_data.servers_data.get(1).unwrap().key_name,
"key 1 name"
);
}