liquid-rust icon indicating copy to clipboard operation
liquid-rust copied to clipboard

`compact` filter doesn't properly work on hashes

Open epage opened this issue 7 years ago • 1 comments

Example test:

    let assigns = v!({
        "words": ["a", nil, "b", nil, "c"],
        "hashes": [{ "a": "A" }, { "a": nil }, { "a": "C" }],
    });

    // Test hashes
    assert_template_result!(
        "A C",
        "{{hashes | compact: 'a' | map: 'a' | join}}",
        assigns
    );
  • Rust implementation
  • Ruby implementation
  • Relevant tests
    • Once this is working, ideally the test will start failing. We would just need to remove the #[should_panic] on it
    • If the test doesn't start failing, please temporarily remove #[should_panic], and find or create an issue for the new failure

epage avatar Nov 30 '18 23:11 epage

This solves issues #335. It also solves some of issue #246, but the filter doesn't yet work on a single hash.

epage avatar Sep 04 '19 17:09 epage