Skip to content

Commit

Permalink
Simplify assertions in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Jun 2, 2019
1 parent a5e92ae commit bdc8ca5
Show file tree
Hide file tree
Showing 26 changed files with 63 additions and 67 deletions.
8 changes: 4 additions & 4 deletions src/completion/bibtex/entry_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() > 0, true);
assert!(!items.is_empty());
}

#[test]
Expand All @@ -88,7 +88,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}

#[test]
Expand All @@ -102,7 +102,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}

#[test]
Expand All @@ -116,6 +116,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}
}
10 changes: 5 additions & 5 deletions src/completion/bibtex/field_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() > 0, true);
assert!(!items.is_empty());
}

#[test]
Expand All @@ -90,7 +90,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() > 0, true);
assert!(!items.is_empty());
}

#[test]
Expand All @@ -104,7 +104,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() > 0, true);
assert!(!items.is_empty());
}

#[test]
Expand All @@ -118,7 +118,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}

#[test]
Expand All @@ -132,6 +132,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}
}
8 changes: 4 additions & 4 deletions src/completion/bibtex/kernel_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() > 0, true);
assert!(!items.is_empty());
}

#[test]
Expand All @@ -78,7 +78,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}

#[test]
Expand All @@ -92,7 +92,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}

#[test]
Expand All @@ -106,6 +106,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() == 0, true);
assert!(items.is_empty());
}
}
4 changes: 2 additions & 2 deletions src/completion/latex/argument_symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(true, items.len() > 0);
assert!(!items.is_empty());
}

#[test]
Expand All @@ -75,6 +75,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(true, items.len() == 0);
assert!(items.is_empty());
}
}
4 changes: 2 additions & 2 deletions src/completion/latex/citation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mod tests {
},
);
assert_eq!(items.len(), 1);
assert_eq!("foo", items[0].label);
assert_eq!(items[0].label, "foo");
}

#[test]
Expand All @@ -77,6 +77,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}
}
4 changes: 2 additions & 2 deletions src/completion/latex/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(true, items.iter().any(|item| item.label == "black"));
assert!(items.iter().any(|item| item.label == "black"));
}

#[test]
Expand All @@ -157,6 +157,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}
}
6 changes: 3 additions & 3 deletions src/completion/latex/color_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() > 0, true);
assert!(!items.is_empty());
}

#[test]
Expand All @@ -92,7 +92,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}

#[test]
Expand All @@ -106,6 +106,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.len() > 0, true);
assert!(!items.is_empty());
}
}
6 changes: 3 additions & 3 deletions src/completion/latex/kernel_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.iter().any(|item| item.label == "usepackage"), true);
assert!(items.iter().any(|item| item.label == "usepackage"));
}

#[test]
Expand All @@ -66,7 +66,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}

#[test]
Expand All @@ -80,6 +80,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}
}
12 changes: 6 additions & 6 deletions src/completion/latex/kernel_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.iter().any(|item| item.label == "document"), true);
assert!(items.iter().any(|item| item.label == "document"));
}

#[test]
Expand All @@ -66,7 +66,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.iter().any(|item| item.label == "document"), true);
assert!(items.iter().any(|item| item.label == "document"));
}

#[test]
Expand All @@ -80,7 +80,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}

#[test]
Expand All @@ -94,7 +94,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}

#[test]
Expand All @@ -108,7 +108,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}

#[test]
Expand All @@ -122,6 +122,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}
}
2 changes: 1 addition & 1 deletion src/completion/latex/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items, Vec::new());
assert!(items.is_empty());
}
}
2 changes: 1 addition & 1 deletion src/completion/latex/pgf_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.iter().any(|item| item.label == "arrows"), true);
assert!(items.iter().any(|item| item.label == "arrows"));
}
}
2 changes: 1 addition & 1 deletion src/completion/latex/tikz_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(items.iter().any(|item| item.label == "arrows"), true);
assert!(items.iter().any(|item| item.label == "arrows"));
}
}
4 changes: 2 additions & 2 deletions src/definition/latex_citation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(locations, Vec::new());
assert!(locations.is_empty());
}

#[test]
Expand All @@ -111,6 +111,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(locations, Vec::new());
assert!(locations.is_empty());
}
}
4 changes: 2 additions & 2 deletions src/definition/latex_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(locations, Vec::new());
assert!(locations.is_empty());
}

#[test]
Expand All @@ -109,6 +109,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(locations, Vec::new());
assert!(locations.is_empty());
}
}
6 changes: 3 additions & 3 deletions src/folding/bibtex_declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(foldings, Vec::new());
assert!(foldings.is_empty());
}

#[test]
Expand All @@ -145,7 +145,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(foldings, Vec::new());
assert!(foldings.is_empty());
}

#[test]
Expand All @@ -158,6 +158,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(foldings, Vec::new());
assert!(foldings.is_empty());
}
}
2 changes: 1 addition & 1 deletion src/folding/latex_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(foldings, Vec::new());
assert!(foldings.is_empty());
}
}
2 changes: 1 addition & 1 deletion src/folding/latex_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(foldings, Vec::new());
assert!(foldings.is_empty());
}
}
4 changes: 2 additions & 2 deletions src/highlight/latex_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(highlights, Vec::new());
assert!(highlights.is_empty());
}

#[test]
Expand All @@ -99,6 +99,6 @@ mod tests {
..FeatureSpec::default()
},
);
assert_eq!(highlights, Vec::new());
assert!(highlights.is_empty());
}
}
Loading

0 comments on commit bdc8ca5

Please sign in to comment.