INNER CODE UNIT · Rust

tokens_with_literal_braces

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

    fn tokens_with_literal_braces() {
        let template =
            CommandTemplate::new(vec!["{{}}", "{{", "{.}}"], ExecutionMode::OneByOne).unwrap();
        assert_eq!(
            generate_str(&template, "foo"),
            vec!["{}", "{", "{.}", "foo"]
        );
    }

    #[test]
    fn tokens_with_literal_braces_and_placeholder() {
        let template =
            CommandTemplate::new(vec!["echo", "{{{},end}"], ExecutionMode::OneByOne).unwrap();
        assert_eq!(generate_str(&template, "foo"), vec!["echo", "{foo,end}"]);
    }

    #[test]
    fn tokens_multiple() {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…