use super::normalize_session_hints;
use crate::backends::hotwords;
use crate::{BiasPhrase, SessionOptions, SpeechHints, TransducerBiasConfig};
#[test]
fn normalized_empty_hints_bias_exactly_like_none_on_supported_backends() {
let bias = TransducerBiasConfig::new(vec![BiasPhrase::new("语音识别")]);
let defaults = hotwords::render_bias(&bias).unwrap();
let options = normalize_session_hints(SessionOptions {
hints: Some(SpeechHints::default()),
..Default::default()
});
assert!(options.hints.is_none());
let with_empty_hints = hotwords::merge(Some(&defaults), options.hints.as_ref()).unwrap();
let without_hints = hotwords::merge(Some(&defaults), None).unwrap();
assert_eq!(with_empty_hints, without_hints);
assert_eq!(with_empty_hints.as_deref(), Some(defaults.as_str()));
}