style(format): reformat code with consistent line breaks and spacing
This commit is contained in:
+38
-31
@@ -269,18 +269,19 @@ async fn test_get_patch() {
|
||||
assert!(combined.contains("diff --git") || combined.contains("@@"));
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_find_changed_paths() {
|
||||
let (_dir, gb) = common::setup_bare_repo();
|
||||
let feature_oid = common::get_feature_oid(&gb);
|
||||
let main_oid = common::get_main_oid(&gb);
|
||||
let resp = gb.find_changed_paths(FindChangedPathsRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
paths: vec![],
|
||||
}).unwrap();
|
||||
let resp = gb
|
||||
.find_changed_paths(FindChangedPathsRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
paths: vec![],
|
||||
})
|
||||
.unwrap();
|
||||
assert!(!resp.paths.is_empty());
|
||||
}
|
||||
|
||||
@@ -288,27 +289,30 @@ fn test_find_changed_paths() {
|
||||
fn test_find_changed_paths_same_ref() {
|
||||
let (_dir, gb) = common::setup_bare_repo();
|
||||
let oid = common::get_main_oid(&gb);
|
||||
let resp = gb.find_changed_paths(FindChangedPathsRequest {
|
||||
repository: Some(hdr()),
|
||||
base: oid.clone(),
|
||||
head: oid,
|
||||
paths: vec![],
|
||||
}).unwrap();
|
||||
let resp = gb
|
||||
.find_changed_paths(FindChangedPathsRequest {
|
||||
repository: Some(hdr()),
|
||||
base: oid.clone(),
|
||||
head: oid,
|
||||
paths: vec![],
|
||||
})
|
||||
.unwrap();
|
||||
assert!(resp.paths.is_empty());
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_raw_diff() {
|
||||
let (_dir, gb) = common::setup_bare_repo();
|
||||
let feature_oid = common::get_feature_oid(&gb);
|
||||
let main_oid = common::get_main_oid(&gb);
|
||||
let chunks = gb.raw_diff(RawDiffRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
options: None,
|
||||
}).unwrap();
|
||||
let chunks = gb
|
||||
.raw_diff(RawDiffRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
options: None,
|
||||
})
|
||||
.unwrap();
|
||||
assert!(!chunks.is_empty());
|
||||
let combined: Vec<u8> = chunks.iter().flat_map(|c| c.data.clone()).collect();
|
||||
let text = String::from_utf8_lossy(&combined);
|
||||
@@ -320,27 +324,30 @@ fn test_raw_patch() {
|
||||
let (_dir, gb) = common::setup_bare_repo();
|
||||
let feature_oid = common::get_feature_oid(&gb);
|
||||
let main_oid = common::get_main_oid(&gb);
|
||||
let chunks = gb.raw_patch(RawPatchRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
}).unwrap();
|
||||
let chunks = gb
|
||||
.raw_patch(RawPatchRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
})
|
||||
.unwrap();
|
||||
assert!(!chunks.is_empty());
|
||||
let combined: Vec<u8> = chunks.iter().flat_map(|c| c.data.clone()).collect();
|
||||
let text = String::from_utf8_lossy(&combined);
|
||||
assert!(text.contains("From"));
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_get_raw_changes() {
|
||||
let (_dir, gb) = common::setup_bare_repo();
|
||||
let feature_oid = common::get_feature_oid(&gb);
|
||||
let main_oid = common::get_main_oid(&gb);
|
||||
let resp = gb.get_raw_changes(GetRawChangesRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
}).unwrap();
|
||||
let resp = gb
|
||||
.get_raw_changes(GetRawChangesRequest {
|
||||
repository: Some(hdr()),
|
||||
base: feature_oid,
|
||||
head: main_oid,
|
||||
})
|
||||
.unwrap();
|
||||
assert!(!resp.changes.is_empty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user