History

[pack-gen] the first green test for Tag iterators

Sebastian Thiel committed 5 years ago

Commit df5ef8a1 parent 18983197 files · +230 −30Browse files

Showing the changes to git-object/tests/immutable/commit.rs (1 of 7 files). Show all

Unified · Split

git-object/tests/immutable/commit.rs+19−19
@@ -137,7 +137,7 @@ mod method { · 136 unmodified lines
137137 use pretty_assertions::assert_eq;
138138
139139 #[test]
140− fn tree() -> Result<(), Box<dyn std::error::Error>> {
140+ fn tree() -> crate::Result {
141141 let fixture = fixture_bytes("commit", "unsigned.txt");
142142 let commit = Commit::from_bytes(&fixture)?;
143143 assert_eq!(commit.tree(), hex_to_id("1b2dfb4ac5e42080b682fc676e9738c94ce6d54d"));
@@ -157,7 +157,7 @@ mod iter { · 13 unmodified lines
157157 use git_object::{bstr::ByteSlice, immutable::commit::iter::Token, immutable::CommitIter};
158158
159159 #[test]
160− fn newline_right_after_signature_multiline_header() -> Result<(), Box<dyn std::error::Error>> {
160+ fn newline_right_after_signature_multiline_header() -> crate::Result {
161161 let data = fixture_bytes("commit", "signed-whitespace.txt");
162162 let tokens = CommitIter::from_bytes(&data).collect::<Result<Vec<_>, _>>()?;
163163 assert_eq!(tokens.len(), 7, "mainly a parsing exercise");
@@ -171,7 +171,7 @@ mod iter { · 7 unmodified lines
171171 }
172172
173173 #[test]
174− fn signed_with_encoding() -> Result<(), Box<dyn std::error::Error>> {
174+ fn signed_with_encoding() -> crate::Result {
175175 assert_eq!(
176176 CommitIter::from_bytes(&fixture_bytes("commit", "signed-with-encoding.txt"))
177177 .collect::<Result<Vec<_>, _>>()?,
@@ -197,7 +197,7 @@ mod iter { · 19 unmodified lines
197197 }
198198
199199 #[test]
200− fn whitespace() -> Result<(), Box<dyn std::error::Error>> {
200+ fn whitespace() -> crate::Result {
201201 assert_eq!(
202202 CommitIter::from_bytes(&fixture_bytes("commit", "whitespace.txt")).collect::<Result<Vec<_>, _>>()?,
203203 vec![
@@ -220,7 +220,7 @@ mod iter { · 16 unmodified lines
220220 }
221221
222222 #[test]
223− fn unsigned() -> Result<(), Box<dyn std::error::Error>> {
223+ fn unsigned() -> crate::Result {
224224 assert_eq!(
225225 CommitIter::from_bytes(&fixture_bytes("commit", "unsigned.txt")).collect::<Result<Vec<_>, _>>()?,
226226 vec![
@@ -240,7 +240,7 @@ mod iter { · 13 unmodified lines
240240 }
241241
242242 #[test]
243− fn signed_singleline() -> Result<(), Box<dyn std::error::Error>> {
243+ fn signed_singleline() -> crate::Result {
244244 assert_eq!(
245245 CommitIter::from_bytes(&fixture_bytes("commit", "signed-singleline.txt")).collect::<Result<Vec<_>, _>>()?,
246246 vec![
@@ -264,7 +264,7 @@ mod iter { · 17 unmodified lines
264264 }
265265
266266 #[test]
267− fn error_handling() -> Result<(), Box<dyn std::error::Error>> {
267+ fn error_handling() -> crate::Result {
268268 let data = fixture_bytes("commit", "unsigned.txt");
269269 let iter = CommitIter::from_bytes(&data[..data.len() / 2]);
270270 let tokens = iter.collect::<Vec<_>>();
@@ -276,7 +276,7 @@ mod iter { · 5 unmodified lines
276276 }
277277
278278 #[test]
279− fn mergetag() -> Result<(), Box<dyn std::error::Error>> {
279+ fn mergetag() -> crate::Result {
280280 assert_eq!(
281281 CommitIter::from_bytes(&fixture_bytes("commit", "mergetag.txt")).collect::<Result<Vec<_>, _>>()?,
282282 vec![
@@ -310,7 +310,7 @@ mod iter { · 27 unmodified lines
310310 use git_object::immutable::CommitIter;
311311
312312 #[test]
313− fn tree_id() -> Result<(), Box<dyn std::error::Error>> {
313+ fn tree_id() -> crate::Result {
314314 assert_eq!(
315315 CommitIter::from_bytes(&fixture_bytes("commit", "unsigned.txt")).tree_id(),
316316 Some(hex_to_id("1b2dfb4ac5e42080b682fc676e9738c94ce6d54d"))
@@ -325,7 +325,7 @@ mod iter { · 8 unmodified lines
325325 }
326326
327327 #[test]
328− fn signatures() -> Result<(), Box<dyn std::error::Error>> {
328+ fn signatures() -> crate::Result {
329329 assert_eq!(
330330 CommitIter::from_bytes(&fixture_bytes("commit", "unsigned.txt"))
331331 .signatures()
@@ -346,7 +346,7 @@ mod from_bytes { · 14 unmodified lines
346346 use smallvec::SmallVec;
347347
348348 #[test]
349− fn unsigned() -> Result<(), Box<dyn std::error::Error>> {
349+ fn unsigned() -> crate::Result {
350350 assert_eq!(
351351 Commit::from_bytes(&fixture_bytes("commit", "unsigned.txt"))?,
352352 Commit {
@@ -363,7 +363,7 @@ mod from_bytes { · 10 unmodified lines
363363 }
364364
365365 #[test]
366− fn whitespace() -> Result<(), Box<dyn std::error::Error>> {
366+ fn whitespace() -> crate::Result {
367367 assert_eq!(
368368 Commit::from_bytes(&fixture_bytes("commit", "whitespace.txt"))?,
369369 Commit {
@@ -380,7 +380,7 @@ mod from_bytes { · 10 unmodified lines
380380 }
381381
382382 #[test]
383− fn signed_singleline() -> Result<(), Box<dyn std::error::Error>> {
383+ fn signed_singleline() -> crate::Result {
384384 assert_eq!(
385385 Commit::from_bytes(&fixture_bytes("commit", "signed-singleline.txt"))?,
386386 Commit {
@@ -397,7 +397,7 @@ mod from_bytes { · 10 unmodified lines
397397 }
398398
399399 #[test]
400− fn mergetag() -> Result<(), Box<dyn std::error::Error>> {
400+ fn mergetag() -> crate::Result {
401401 let fixture = fixture_bytes("commit", "mergetag.txt");
402402 let commit = Commit {
403403 tree: b"1c61918031bf2c7fab9e17dde3c52a6a9884fcb5".as_bstr(),
@@ -421,7 +421,7 @@ mod from_bytes { · 17 unmodified lines
421421 }
422422
423423 #[test]
424− fn signed() -> Result<(), Box<dyn std::error::Error>> {
424+ fn signed() -> crate::Result {
425425 assert_eq!(
426426 Commit::from_bytes(&fixture_bytes("commit", "signed.txt"))?,
427427 Commit {
@@ -438,7 +438,7 @@ mod from_bytes { · 10 unmodified lines
438438 }
439439
440440 #[test]
441− fn signed_with_encoding() -> Result<(), Box<dyn std::error::Error>> {
441+ fn signed_with_encoding() -> crate::Result {
442442 assert_eq!(
443443 Commit::from_bytes(&fixture_bytes("commit", "signed-with-encoding.txt"))?,
444444 Commit {
@@ -455,7 +455,7 @@ mod from_bytes { · 10 unmodified lines
455455 }
456456
457457 #[test]
458− fn with_encoding() -> Result<(), Box<dyn std::error::Error>> {
458+ fn with_encoding() -> crate::Result {
459459 assert_eq!(
460460 Commit::from_bytes(&fixture_bytes("commit", "with-encoding.txt"))?,
461461 Commit {
@@ -472,7 +472,7 @@ mod from_bytes { · 10 unmodified lines
472472 }
473473
474474 #[test]
475− fn merge() -> Result<(), Box<dyn std::error::Error>> {
475+ fn merge() -> crate::Result {
476476 assert_eq!(
477477 Commit::from_bytes(&fixture_bytes("commit", "merge.txt"))?,
478478 Commit {
@@ -504,7 +504,7 @@ iyBBl69jASy41Ug/BlFJbw4+ItkShpXwkJKuBBV/JExChmvbxYWaS7QnyYC9UO0= · 25 unmodified lines
504504 ";
505505
506506 #[test]
507− fn newline_right_after_signature_multiline_header() -> Result<(), Box<dyn std::error::Error>> {
507+ fn newline_right_after_signature_multiline_header() -> crate::Result {
508508 let fixture = fixture_bytes("commit", "signed-whitespace.txt");
509509 let commit = Commit::from_bytes(&fixture)?;
510510 let pgp_sig = OTHER_SIGNATURE.as_bstr();

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