Release v2.0.0
CI / Windows baseline (push) Canceled after 0s

This commit is contained in:
2026-09-10 20:59:52 +03:00
parent 9c987df6e9
commit efda8eb98f
142 changed files with 68308 additions and 9333 deletions
+43
View File
@@ -86,6 +86,49 @@ fn skips_singbox_check_when_binary_path_is_not_supplied() {
assert!(checker.calls.borrow().is_empty());
}
#[test]
fn same_endpoint_uses_exact_outbound_id_and_never_falls_back_from_missing_id() {
let parsed = proxywarden_lib::subscription::parse_subscription_body(r#"{"outbounds":[
{"type":"vless","tag":"same%20label","server":"edge.example.test","server_port":443,"uuid":"11111111-1111-1111-1111-111111111111"},
{"type":"vless","tag":"same%20label","server":"edge.example.test","server_port":443,"uuid":"22222222-2222-2222-2222-222222222222"}
]}"#).unwrap();
let mut cache = SubscriptionCache {
config: parsed.config,
servers: parsed.servers,
user_info: Default::default(),
fetched_at: "fixture".into(),
};
let mut config = local_singbox_config("same label");
config.selected_server_id = Some(cache.servers[1].id.clone());
cache.normalize_percent_encoded_tags();
let adapter = SingBoxAdapter::default();
let generated = adapter
.generate_config(
SingBoxGenerationRequest::new(&config, &cache, None),
&RecordingChecker::ok("fixture"),
)
.unwrap();
let value: serde_json::Value = serde_json::from_str(&generated.contents).unwrap();
assert_eq!(
value["outbounds"][0]["uuid"],
"22222222-2222-2222-2222-222222222222"
);
config.selected_server_id = Some("pw-missing".into());
assert!(adapter
.generate_config(
SingBoxGenerationRequest::new(&config, &cache, None),
&RecordingChecker::ok("fixture")
)
.is_err());
config.selected_server_id = None;
assert!(adapter
.generate_config(
SingBoxGenerationRequest::new(&config, &cache, None),
&RecordingChecker::ok("fixture")
)
.is_err());
}
#[test]
fn blocks_config_when_server_is_not_selected() {
let adapter = SingBoxAdapter::default();