| @@ -1,42 +1,61 @@ |
| 1 | use crate::matching::baseline; | 1 | mod single { |
| | 2 | use crate::matching::baseline; |
| 2 | | 3 | |
| 3 | #[test] | 4 | #[test] |
| 4 | fn fetch_only() { | 5 | fn fetch_only() { |
| 5 | baseline::agrees_with_fetch_specs(Some("refs/heads/main")); | 6 | baseline::agrees_with_fetch_specs(Some("refs/heads/main")); |
| 6 | baseline::agrees_with_fetch_specs(Some("heads/main")); | 7 | baseline::agrees_with_fetch_specs(Some("heads/main")); |
| 7 | baseline::agrees_with_fetch_specs(Some("main")); | 8 | baseline::agrees_with_fetch_specs(Some("main")); |
| 8 | baseline::agrees_with_fetch_specs(Some("v0.0-f1")); | 9 | baseline::agrees_with_fetch_specs(Some("v0.0-f1")); |
| 9 | baseline::agrees_with_fetch_specs(Some("tags/v0.0-f2")); | 10 | baseline::agrees_with_fetch_specs(Some("tags/v0.0-f2")); |
| 10 | baseline::of_objects_always_matches_if_the_server_has_the_object(Some("78b1c1be9421b33a49a7a8176d93eeeafa112da1")); | 11 | baseline::of_objects_always_matches_if_the_server_has_the_object(Some( |
| 11 | baseline::of_objects_always_matches_if_the_server_has_the_object(Some("9d2fab1a0ba3585d0bc50922bfdd04ebb59361df")); | 12 | "78b1c1be9421b33a49a7a8176d93eeeafa112da1", |
| | 13 | )); |
| | 14 | baseline::of_objects_always_matches_if_the_server_has_the_object(Some( |
| | 15 | "9d2fab1a0ba3585d0bc50922bfdd04ebb59361df", |
| | 16 | )); |
| | 17 | } |
| | 18 | |
| | 19 | #[test] |
| | 20 | fn fetch_and_update() { |
| | 21 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( |
| | 22 | Some("78b1c1be9421b33a49a7a8176d93eeeafa112da1:special"), |
| | 23 | ["78b1c1be9421b33a49a7a8176d93eeeafa112da1:refs/heads/special"], |
| | 24 | ); |
| | 25 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( |
| | 26 | Some("78b1c1be9421b33a49a7a8176d93eeeafa112da1:1111111111111111111111111111111111111111"), |
| | 27 | ["78b1c1be9421b33a49a7a8176d93eeeafa112da1:refs/heads/1111111111111111111111111111111111111111"], |
| | 28 | ); |
| | 29 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( |
| | 30 | Some("9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:tags/special"), |
| | 31 | ["9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:refs/tags/special"], |
| | 32 | ); |
| | 33 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( |
| | 34 | Some("9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:refs/tags/special"), |
| | 35 | ["9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:refs/tags/special"], |
| | 36 | ); |
| | 37 | |
| | 38 | baseline::agrees_but_observable_refs_are_vague(Some("f1:origin/f1"), ["refs/heads/f1:refs/heads/origin/f1"]); |
| | 39 | baseline::agrees_but_observable_refs_are_vague( |
| | 40 | Some("f1:remotes/origin/f1"), |
| | 41 | ["refs/heads/f1:refs/remotes/origin/f1"], |
| | 42 | ); |
| | 43 | baseline::agrees_but_observable_refs_are_vague(Some("f1:notes/f1"), ["refs/heads/f1:refs/heads/notes/f1"]); |
| | 44 | baseline::agrees_with_fetch_specs(Some("+refs/heads/*:refs/remotes/origin/*")); |
| | 45 | baseline::agrees_with_fetch_specs(Some("refs/heads/f*:refs/remotes/origin/a*")); |
| | 46 | baseline::agrees_with_fetch_specs(Some("refs/heads/*1:refs/remotes/origin/*1")); |
| | 47 | } |
| 12 | } | 48 | } |
| 13 | | 49 | |
| 14 | #[test] | 50 | mod multiple { |
| 15 | fn fetch_and_update() { | 51 | use crate::matching::baseline; |
| 16 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( | | |
| 17 | Some("78b1c1be9421b33a49a7a8176d93eeeafa112da1:special"), | | |
| 18 | ["78b1c1be9421b33a49a7a8176d93eeeafa112da1:refs/heads/special"], | | |
| 19 | ); | | |
| 20 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( | | |
| 21 | Some("78b1c1be9421b33a49a7a8176d93eeeafa112da1:1111111111111111111111111111111111111111"), | | |
| 22 | ["78b1c1be9421b33a49a7a8176d93eeeafa112da1:refs/heads/1111111111111111111111111111111111111111"], | | |
| 23 | ); | | |
| 24 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( | | |
| 25 | Some("9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:tags/special"), | | |
| 26 | ["9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:refs/tags/special"], | | |
| 27 | ); | | |
| 28 | baseline::of_objects_with_destinations_are_written_into_given_local_branches( | | |
| 29 | Some("9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:refs/tags/special"), | | |
| 30 | ["9d2fab1a0ba3585d0bc50922bfdd04ebb59361df:refs/tags/special"], | | |
| 31 | ); | | |
| 32 | | 52 | |
| 33 | baseline::agrees_but_observable_refs_are_vague(Some("f1:origin/f1"), ["refs/heads/f1:refs/heads/origin/f1"]); | 53 | #[test] |
| 34 | baseline::agrees_but_observable_refs_are_vague( | 54 | fn fetch_only() { |
| 35 | Some("f1:remotes/origin/f1"), | 55 | baseline::agrees_with_fetch_specs(["main", "f1"]); |
| 36 | ["refs/heads/f1:refs/remotes/origin/f1"], | 56 | baseline::agrees_with_fetch_specs(["heads/main", "heads/f1"]); |
| 37 | ); | 57 | baseline::agrees_with_fetch_specs(["refs/heads/main", "refs/heads/f1"]); |
| 38 | baseline::agrees_but_observable_refs_are_vague(Some("f1:notes/f1"), ["refs/heads/f1:refs/heads/notes/f1"]); | 58 | baseline::agrees_with_fetch_specs(["heads/f1", "f2", "refs/heads/f3", "heads/main"]); |
| 39 | baseline::agrees_with_fetch_specs(Some("+refs/heads/*:refs/remotes/origin/*")); | 59 | baseline::agrees_with_fetch_specs(["f*:a*", "refs/heads/main"]); |
| 40 | baseline::agrees_with_fetch_specs(Some("refs/heads/f*:refs/remotes/origin/a*")); | 60 | } |
| 41 | baseline::agrees_with_fetch_specs(Some("refs/heads/*1:refs/remotes/origin/*1")); | | |
| 42 | } | 61 | } |