Skip to content

test as documentation #9

@danielecr

Description

@danielecr

I was looking for a crate just like this, but I had to look at the code to see if works when replaced text contains other replacement.
Can be added a test case like this:

    #[test]
    fn test_hashmap_replacement_skip_nested() {
        let mut table = HashMap::new();
        table.insert("placeholder", "{{crazy}}");
        table.insert("crazy", "{{placeholder}}");

        assert_eq!(
            Template::new("hello {{placeholder}} world of {{crazy}}").fill_with_hashmap(&table),
            "hello {{crazy}} world of {{placeholder}}"
        );
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions