Add Database::user_known_bash_tags()

This commit is contained in:
Oliver Hamlet
2026-01-02 15:30:24 +00:00
parent e72a0de8c7
commit 2fe107d66b
9 changed files with 87 additions and 0 deletions
+22
View File
@@ -173,6 +173,13 @@ impl Database {
tags
}
/// Gets the Bash Tags that are listed in the loaded userlist.
///
/// Bash Tag suggestions can include Bash Tags not in this list.
pub fn user_known_bash_tags(&self) -> &[String] {
self.userlist.bash_tags()
}
/// Get all general messages listed in the loaded metadata lists.
pub fn general_messages(
&self,
@@ -892,6 +899,21 @@ plugins:
);
}
#[test]
fn user_known_bash_tags_should_return_only_known_bash_tags_in_the_userlist() {
let fixture = Fixture::new(GameType::Oblivion);
let mut database = fixture.database();
database.load_masterlist(&fixture.metadata_path).unwrap();
let userlist_path = fixture.inner.local_path.join("userlist.yaml");
std::fs::write(&userlist_path, "bash_tags: [Relev, Delev]").unwrap();
database.load_userlist(&userlist_path).unwrap();
assert_eq!(&["Relev", "Delev"], database.user_known_bash_tags());
}
mod general_messages {
use super::*;