Skip to content

Commit

Permalink
refactor (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed May 29, 2022
1 parent b884189 commit eeb5e70
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions git-revision/tests/spec/mod.rs
Expand Up @@ -29,21 +29,21 @@ mod parse {
}
}

fn b(s: &str) -> &BStr {
s.into()
fn parse(spec: &str) -> Recorder {
let mut rec = Recorder::default();
spec::parse(spec.into(), &mut rec).unwrap();
rec
}

#[test]
fn at_alone_is_shortcut_for_head() {
let mut rec = Recorder::default();
spec::parse(b("@"), &mut rec).unwrap();
fn at_by_iteself_is_shortcut_for_head() {
let rec = parse("@");
assert_eq!(rec.resolve_ref_input.unwrap(), "HEAD");
}

#[test]
fn refname() {
let mut rec = Recorder::default();
spec::parse(b("HEAD"), &mut rec).unwrap();
fn refname_head() {
let rec = parse("HEAD");
assert_eq!(rec.resolve_ref_input.unwrap(), "HEAD");
}
}

0 comments on commit eeb5e70

Please sign in to comment.