use std::path::PathBuf;
use sup_xml_core::{ParseOptions, parse_str};
#[test]
fn parsing_without_a_license_is_rejected() {
let empty: PathBuf =
std::env::temp_dir().join(format!("supso-unlicensed-{}", std::process::id()));
std::fs::create_dir_all(&empty).unwrap();
unsafe {
std::env::remove_var("SUPSO_LICENSE_PATH");
std::env::set_var("HOME", &empty);
std::env::set_var("USERPROFILE", &empty);
}
std::env::set_current_dir(&empty).unwrap();
let err = parse_str("<r/>", &ParseOptions::default())
.expect_err("parsing must be rejected without a valid license");
let msg = err.to_string();
assert!(msg.contains("license"), "expected a license error, got: {msg}");
}