summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbin Simon <abinsimon10@gmail.com>2021-02-15 10:46:03 +0530
committerAbin Simon <abinsimon10@gmail.com>2021-02-17 09:21:58 +0530
commit22f5a6b992ca0a6708e8d095a2d5e6d2c52ad458 (patch)
treed884ebe9fe49d88f78c385f210e797576df13e0a
parent7fad2056826d9cb110cb68b6103f1b55d85cfdef (diff)
Fix test involving config file for sorting
-rw-r--r--CHANGELOG.md3
-rw-r--r--src/config_file.rs7
-rw-r--r--src/flags/sorting.rs2
3 files changed, 10 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9564504..e8ba3d3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,8 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Not showing `.` and `..` when `--tree` with `--all` from [zwpaper](https://github.com/zwpaper) [#477](https://github.com/Peltoche/lsd/issues/477)
### Fixed
- Fix handling blocks passed without -l in cli from [meain](https://github.com/meain)
-- Fixed sorting of . and .. when used with folder from [meain](https://github.com/meain)
+- Fix sorting of . and .. when used with folder from [meain](https://github.com/meain)
- Fix arg parsing for flags that allow multiple values from [meain](https://github.com/meain)
+- Fix tests involving config file for sorting from [meain](https://github.com/meain)
## [0.19.0] - 2020-12-13
### Added
diff --git a/src/config_file.rs b/src/config_file.rs
index 228d0f9..c7c1b3d 100644
--- a/src/config_file.rs
+++ b/src/config_file.rs
@@ -276,6 +276,13 @@ symlink-arrow: ⇒
"#;
#[cfg(test)]
+impl Config {
+ pub fn builtin() -> Self {
+ Self::from_yaml(DEFAULT_CONFIG).unwrap()
+ }
+}
+
+#[cfg(test)]
mod tests {
use super::Config;
use crate::config_file;
diff --git a/src/flags/sorting.rs b/src/flags/sorting.rs
index 550486c..5395b99 100644
--- a/src/flags/sorting.rs
+++ b/src/flags/sorting.rs
@@ -417,7 +417,7 @@ mod test_sort_order {
fn test_from_config_default_config() {
assert_eq!(
Some(SortOrder::default()),
- SortOrder::from_config(&Config::default())
+ SortOrder::from_config(&Config::builtin())
);
}