INNER CODE UNIT · Rust

placeholder_as_executable_rejected

sharkdp/fd · src/exec/mod.rs:439

    fn placeholder_as_executable_rejected() {
        assert!(CommandSet::new(vec![vec!["{}"]]).is_ok());
        assert!(CommandSet::new(vec![vec!["{/}", "arg"]]).is_ok());
        assert!(CommandSet::new_batch(vec![vec!["{}"]]).is_err());
    }

    #[test]
    fn generate_custom_path_separator() {
        let arg = FormatTemplate::Tokens(vec![Token::Placeholder]);
        macro_rules! check {
            ($input:expr, $expected:expr) => {
                assert_eq!(arg.generate($input, Some("#")), OsString::from($expected));
            };
        }

        check!("foo", "foo");
        check!("foo/bar", "foo#bar");
        check!("/foo/bar/baz", "#foo#bar#baz");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…