+
+ #[test]
+ fn test_node_with_known_relevant_init_flags() {
+ // Create an InitFeatures with initial_routing_sync supported.
+ let mut init_features = InitFeatures::supported();
+ init_features.set_initial_routing_sync();
+
+ // Attempt to pull out non-node-context feature flags from these InitFeatures.
+ let res = NodeFeatures::with_known_relevant_init_flags(&init_features);
+
+ {
+ // Check that the flags are as expected.
+ assert_eq!(res.flags[0], 0b00100010);
+ assert_eq!(res.flags[1], 0b00000010);
+ assert_eq!(res.flags.len(), 2);
+ }
+
+ // Check that the initial_routing_sync feature was correctly blanked out.
+ let new_features: InitFeatures = Features::from_le_bytes(res.flags);
+ assert!(!new_features.initial_routing_sync());
+ }