11#![ allow( dead_code) ]
22
3- use std:: collections:: HashMap ;
3+ use std:: collections:: BTreeMap ;
44
55use crate :: issue:: { Disallowed , Issue , IssueKind , NonUpstream , Outdated } ;
66use crate :: FlakeCheckerError ;
@@ -33,8 +33,8 @@ impl Default for FlakeCheckConfig {
3333pub ( super ) fn nixpkgs_deps (
3434 flake_lock : & FlakeLock ,
3535 keys : & [ String ] ,
36- ) -> Result < HashMap < String , Node > , FlakeCheckerError > {
37- let mut deps: HashMap < String , Node > = HashMap :: new ( ) ;
36+ ) -> Result < BTreeMap < String , Node > , FlakeCheckerError > {
37+ let mut deps: BTreeMap < String , Node > = BTreeMap :: new ( ) ;
3838
3939 for ( ref key, node) in flake_lock. root . clone ( ) {
4040 match & node {
@@ -144,7 +144,7 @@ pub(super) fn num_days_old(timestamp: i64) -> i64 {
144144
145145#[ cfg( test) ]
146146mod test {
147- use std:: collections:: HashMap ;
147+ use std:: collections:: BTreeMap ;
148148 use std:: path:: PathBuf ;
149149
150150 use crate :: {
@@ -171,7 +171,7 @@ mod test {
171171 ) ,
172172 ] ;
173173
174- let ref_statuses: HashMap < String , String > =
174+ let ref_statuses: BTreeMap < String , String > =
175175 serde_json:: from_str ( include_str ! ( "../ref-statuses.json" ) ) . unwrap ( ) ;
176176 let supported_refs = supported_refs ( ref_statuses. clone ( ) ) ;
177177 let path = PathBuf :: from ( "tests/flake.cel.0.lock" ) ;
@@ -204,7 +204,7 @@ mod test {
204204
205205 #[ test]
206206 fn clean_flake_locks ( ) {
207- let ref_statuses: HashMap < String , String > =
207+ let ref_statuses: BTreeMap < String , String > =
208208 serde_json:: from_str ( include_str ! ( "../ref-statuses.json" ) ) . unwrap ( ) ;
209209 let allowed_refs = supported_refs ( ref_statuses) ;
210210 for n in 0 ..=7 {
@@ -225,7 +225,7 @@ mod test {
225225
226226 #[ test]
227227 fn dirty_flake_locks ( ) {
228- let ref_statuses: HashMap < String , String > =
228+ let ref_statuses: BTreeMap < String , String > =
229229 serde_json:: from_str ( include_str ! ( "../ref-statuses.json" ) ) . unwrap ( ) ;
230230 let allowed_refs = supported_refs ( ref_statuses) ;
231231 let cases: Vec < ( & str , Vec < Issue > ) > = vec ! [
@@ -280,7 +280,7 @@ mod test {
280280
281281 #[ test]
282282 fn explicit_nixpkgs_keys ( ) {
283- let ref_statuses: HashMap < String , String > =
283+ let ref_statuses: BTreeMap < String , String > =
284284 serde_json:: from_str ( include_str ! ( "../ref-statuses.json" ) ) . unwrap ( ) ;
285285 let allowed_refs = supported_refs ( ref_statuses) ;
286286 let cases: Vec < ( & str , Vec < String > , Vec < Issue > ) > = vec ! [ (
@@ -309,7 +309,7 @@ mod test {
309309
310310 #[ test]
311311 fn missing_nixpkgs_keys ( ) {
312- let ref_statuses: HashMap < String , String > =
312+ let ref_statuses: BTreeMap < String , String > =
313313 serde_json:: from_str ( include_str ! ( "../ref-statuses.json" ) ) . unwrap ( ) ;
314314 let allowed_refs = supported_refs ( ref_statuses) ;
315315 let cases: Vec < ( & str , Vec < String > , String ) > = vec ! [ (
0 commit comments