MCPcopy Create free account
hub / github.com/bootc-dev/bootc / test_find_all

Function test_find_all

crates/kernel_cmdline/src/bytes.rs:864–874  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

862
863 #[test]
864 fn test_find_all() {
865 let kargs =
866 Cmdline::from(b"foo=bar rd.foo=a rd.bar=b rd.baz rd.qux=c notrd.val=d".as_slice());
867 let mut rd_args: Vec<_> = kargs.find_all_starting_with(b"rd.".as_slice()).collect();
868 rd_args.sort_by(|a, b| a.key.0.cmp(b.key.0));
869 assert_eq!(rd_args.len(), 4);
870 assert_eq!(rd_args[0], param("rd.bar=b"));
871 assert_eq!(rd_args[1], param("rd.baz"));
872 assert_eq!(rd_args[2], param("rd.foo=a"));
873 assert_eq!(rd_args[3], param("rd.qux=c"));
874 }
875
876 #[test]
877 fn test_add() {

Callers

nothing calls this directly

Calls 2

cmpMethod · 0.45

Tested by

no test coverage detected