Patchwork [11,of,11] rust-dirstate: remove test case for DirsMultiset::new(Manifest, Some)

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 17, 2019, 12:12 p.m.
Message ID <24f0204173d07b53cdd3.1566043932@mimosa>
Download mbox | patch
Permalink /patch/41333/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 17, 2019, 12:12 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1566034135 -32400
#      Sat Aug 17 18:28:55 2019 +0900
# Node ID 24f0204173d07b53cdd34b75122b46cd74df3756
# Parent  c0660c41e5b27173f73b8c88da1728b69425aeba
rust-dirstate: remove test case for DirsMultiset::new(Manifest, Some)

It's no longer possible.
Raphaël Gomès - Aug. 21, 2019, 1:32 p.m.
The entire series looks good to me.

On 8/17/19 2:12 PM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1566034135 -32400
> #      Sat Aug 17 18:28:55 2019 +0900
> # Node ID 24f0204173d07b53cdd34b75122b46cd74df3756
> # Parent  c0660c41e5b27173f73b8c88da1728b69425aeba
> rust-dirstate: remove test case for DirsMultiset::new(Manifest, Some)
>
> It's no longer possible.
>
> diff --git a/rust/hg-core/src/dirstate/dirs_multiset.rs b/rust/hg-core/src/dirstate/dirs_multiset.rs
> --- a/rust/hg-core/src/dirstate/dirs_multiset.rs
> +++ b/rust/hg-core/src/dirstate/dirs_multiset.rs
> @@ -283,24 +283,6 @@ mod tests {
>   
>       #[test]
>       fn test_dirsmultiset_new_skip() {
> -        let input_vec = ["a/", "b/", "a/c", "a/d/"]
> -            .iter()
> -            .map(|e| e.as_bytes().to_vec())
> -            .collect();
> -        let expected_inner = [("", 2), ("a", 3), ("b", 1), ("a/d", 1)]
> -            .iter()
> -            .map(|(k, v)| (k.as_bytes().to_vec(), *v))
> -            .collect();
> -
> -        // this was
> -        // DirsMultiset::new(Manifest(&input_vec), Some(EntryState::Normal))
> -        let new = DirsMultiset::from_manifest(&input_vec);
> -        let expected = DirsMultiset {
> -            inner: expected_inner,
> -        };
> -        // Skip does not affect a manifest
> -        assert_eq!(expected, new);
> -
>           let input_map = [
>               ("a/", EntryState::Normal),
>               ("a/b/", EntryState::Normal),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/rust/hg-core/src/dirstate/dirs_multiset.rs b/rust/hg-core/src/dirstate/dirs_multiset.rs
--- a/rust/hg-core/src/dirstate/dirs_multiset.rs
+++ b/rust/hg-core/src/dirstate/dirs_multiset.rs
@@ -283,24 +283,6 @@  mod tests {
 
     #[test]
     fn test_dirsmultiset_new_skip() {
-        let input_vec = ["a/", "b/", "a/c", "a/d/"]
-            .iter()
-            .map(|e| e.as_bytes().to_vec())
-            .collect();
-        let expected_inner = [("", 2), ("a", 3), ("b", 1), ("a/d", 1)]
-            .iter()
-            .map(|(k, v)| (k.as_bytes().to_vec(), *v))
-            .collect();
-
-        // this was
-        // DirsMultiset::new(Manifest(&input_vec), Some(EntryState::Normal))
-        let new = DirsMultiset::from_manifest(&input_vec);
-        let expected = DirsMultiset {
-            inner: expected_inner,
-        };
-        // Skip does not affect a manifest
-        assert_eq!(expected, new);
-
         let input_map = [
             ("a/", EntryState::Normal),
             ("a/b/", EntryState::Normal),