History

Another test to validate components must not be empty

Sebastian Thiel committed 4 years ago

Commit b2c9af11 parent aa5d66f1 file · +8 −0Browse files

Unified · Split

git-refspec/tests/parse/invalid.rs+8−0
@@ -7,6 +7,14 @@ fn empty() { · 6 unmodified lines
77 assert!(matches!(try_parse("", Operation::Push).unwrap_err(), Error::Empty));
88 }
99
10+#[test]
11+fn empty_component() {
12+ assert!(matches!(
13+ try_parse("refs/heads/test:refs/remotes//test", Operation::Fetch).unwrap_err(),
14+ Error::ReferenceName(git_validate::refname::Error::RepeatedSlash)
15+ ));
16+}
17+
1018 #[test]
1119 fn complex_patterns_with_more_than_one_asterisk() {
1220 for op in [Operation::Fetch, Operation::Push] {