History

This didn't get better, but probably will stay that way (#301)

Sebastian Thiel committed 4 years ago

Commit 7da239f1 parent 2ae129a1 file · +8 −11Browse files

Unified · Split

git-ref/tests/packed/find.rs+8−11
@@ -1,4 +1,4 @@
1−use std::convert::TryInto;
1+use std::convert::{TryFrom, TryInto};
22
33 use git_ref::packed;
44 use git_testtools::fixture_path;
@@ -8,16 +8,13 @@ use crate::{ · 3 unmodified lines
88 packed::write_packed_refs_with,
99 };
1010
11−// TODO: figure this out
12−// #[test]
13−// fn a_lock_file_would_not_be_a_valid_partial_name() {
14−// // doesn't really belong here but want to make sure refname validation works as expected.
15−// let err: &PartialNameRef = "heads/hello.lock".try_into().expect_err("this should fail");
16−// assert_eq!(
17−// err.as_bstr().to_string(),
18−// "A reference must be a valid tag name as well"
19−// );
20−// }
11+#[test]
12+fn a_lock_file_would_not_be_a_valid_partial_name() {
13+ // doesn't really belong here but want to make sure refname validation works as expected.
14+ // let err: &git_ref::PartialNameRef = "heads/hello.lock".try_into().expect_err("this should fail");
15+ let err = <&git_ref::PartialNameRef as TryFrom<_>>::try_from("heads/hello.lock").expect_err("this should fail");
16+ assert_eq!(err.to_string(), "A reference must be a valid tag name as well");
17+}
2118
2219 #[test]
2320 fn all_iterable_refs_can_be_found() -> crate::Result {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t