Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hklsiteimprove committed Mar 26, 2020
1 parent f6a79ef commit 1b0276e
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions fpie/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,25 @@ mod tests {
#[test]
fn test_finds_all_includes() {
let expected = vec!("*");
let actual = get_include_list(lines_from_file("../testfixtures/simple/exclude.txt"));
let actual = get_include_list(
vec!(
"*".to_string(),
"!exclude.txt".to_string()
)
);
assert_eq!(expected, actual);
}

#[test]
fn test_finds_all_excludes() {
let expected = vec!("exclude*", "include.txt");
let actual = get_exclude_list(lines_from_file("../testfixtures/simple/exclude.txt"));
let actual = get_exclude_list(
vec!(
"!exclude*".to_string(),
"!include.txt".to_string(),
"included".to_string()
)
);
assert_eq!(expected, actual);
}

Expand All @@ -98,7 +109,9 @@ mod tests {
"../testfixtures/simple/foo.txt",
"../testfixtures/simple/include.txt"
);
let actual = expand_globs_to_files("../testfixtures/simple", get_include_list(lines_from_file("../testfixtures/simple/exclude.txt")));
let actual = expand_globs_to_files(
"../testfixtures/simple",
get_include_list(vec!("*".to_string())));
assert_eq!(expected, actual);
}

Expand All @@ -109,7 +122,15 @@ mod tests {
"../testfixtures/simple/exclude.txt",
"../testfixtures/simple/include.txt"
);
let actual = expand_globs_to_files("../testfixtures/simple", get_exclude_list(lines_from_file("../testfixtures/simple/exclude.txt")));
let actual = expand_globs_to_files(
"../testfixtures/simple",
get_exclude_list(
vec!(
"!exclude*".to_string(),
"!include.txt".to_string()
)
)
);
assert_eq!(expected, actual);
}

Expand Down

0 comments on commit 1b0276e

Please sign in to comment.