Skip to content

Commit

Permalink
Fix test involving config file for sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
meain committed Feb 17, 2021
1 parent 7fad205 commit 22f5a6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/config_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ total-size: false
symlink-arrow: ⇒
"#;

#[cfg(test)]
impl Config {
pub fn builtin() -> Self {
Self::from_yaml(DEFAULT_CONFIG).unwrap()
}
}

#[cfg(test)]
mod tests {
use super::Config;
Expand Down
2 changes: 1 addition & 1 deletion src/flags/sorting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
);
}

Expand Down

0 comments on commit 22f5a6b

Please sign in to comment.