mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-05 00:12:20 +00:00
feat(bls): read the loader.conf preferred key and strip quotes
This commit is contained in:
1 parent
4794de9db5
commit
cd49b27ccb
2 files changed
+41
-3
No files matched your search
@@ -846,6 +846,27 @@ mod tests {
|
||||
assert_eq!(boot_path(""), "/");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn loader_conf_reads_preferred() {
|
||||
let conf = LoaderConf::parse("preferred fedora-*\n");
|
||||
assert_eq!(conf.preferred.as_deref(), Some("fedora-*"));
|
||||
assert!(conf.warnings.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn loader_conf_strips_matching_quotes() {
|
||||
let conf = LoaderConf::parse("default \"foo*\"\npreferred 'bar'\ntimeout \"3\"\n");
|
||||
assert_eq!(conf.default.as_deref(), Some("foo*"));
|
||||
assert_eq!(conf.preferred.as_deref(), Some("bar"));
|
||||
assert_eq!(conf.timeout, Some(LoaderTimeout::Seconds(3)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn loader_conf_keeps_unmatched_quotes() {
|
||||
let conf = LoaderConf::parse("default \"foo\n");
|
||||
assert_eq!(conf.default.as_deref(), Some("\"foo"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn loader_conf_empty_has_no_settings() {
|
||||
let conf = LoaderConf::parse("");
|
||||
|
||||
Reference in new issue
Block a user