@@ -92,6 +92,19 @@ fn yanked() -> crate::Result {
9292 Ok ( ( ) )
9393}
9494
95+ #[ test]
96+ fn yanked2 ( ) -> crate :: Result {
97+ let changes = changes2 ( index_ro ( ) ?, ":/Yanking crate `github_release_rs#0.1.0`" ) ?;
98+ assert_eq ! ( changes. len( ) , 1 ) ;
99+ assert_eq ! (
100+ changes
101+ . first( )
102+ . and_then( |c| c. yanked( ) . map( |v| v. name. as_str( ) ) ) ,
103+ Some ( "github_release_rs" )
104+ ) ;
105+ Ok ( ( ) )
106+ }
107+
95108#[ test]
96109fn unyanked_crates_recognized_as_added ( ) -> crate :: Result {
97110 let changes = changes ( & index_ro ( ) ?, ":/Unyanking crate `git2mail#0.3.2`" ) ?;
@@ -105,6 +118,19 @@ fn unyanked_crates_recognized_as_added() -> crate::Result {
105118 Ok ( ( ) )
106119}
107120
121+ #[ test]
122+ fn unyanked_crates_recognized_as_added2 ( ) -> crate :: Result {
123+ let changes = changes2 ( index_ro ( ) ?, ":/Unyanking crate `git2mail#0.3.2`" ) ?;
124+ assert_eq ! ( changes. len( ) , 1 ) ;
125+ assert_eq ! (
126+ changes
127+ . first( )
128+ . and_then( |c| c. added( ) . map( |v| v. name. as_str( ) ) ) ,
129+ Some ( "git2mail" )
130+ ) ;
131+ Ok ( ( ) )
132+ }
133+
108134#[ test]
109135fn normalization ( ) -> crate :: Result {
110136 let changes = changes ( & index_ro ( ) ?, ":/normalize" ) ?;
@@ -116,6 +142,17 @@ fn normalization() -> crate::Result {
116142 Ok ( ( ) )
117143}
118144
145+ #[ test]
146+ fn normalization2 ( ) -> crate :: Result {
147+ let changes = changes2 ( index_ro ( ) ?, ":/normalize" ) ?;
148+ assert_eq ! (
149+ changes. len( ) ,
150+ 2356 , // should be 0
151+ "normalization changes the representation, but the data itself stays the same, BUT we can't do it yet"
152+ ) ;
153+ Ok ( ( ) )
154+ }
155+
119156fn changes ( index : & Index , revspec : & str ) -> crate :: Result < Vec < Change > > {
120157 let repo = git:: open ( index. repository ( ) . path ( ) ) ?;
121158 let commit = repo. rev_parse ( revspec) ?. single ( ) . unwrap ( ) ;
0 commit comments