With a focus on quality and design, we curate products that enhance your everyday.
Liquid new array filters test harness
Rendered at: 2026-02-20 20:11:12
Template: index
0) Basic custom arrays (strings only)
str_arr: ["alpha","beta","gamma","Alpha","ALPHA","foo bar","foo_bar","123"]
num_str_arr: ["1","2","3","10","20","30"]
mixed_arr: ["true","false","","0","1","Alpha"]
0.0) Numeric coercion sanity check (strings -> numbers)
[s="1" => (s | plus: 0)=1] [s="2" => (s | plus: 0)=2] [s="3" => (s | plus: 0)=3] [s="10" => (s | plus: 0)=10] [s="20" => (s | plus: 0)=20] [s="30" => (s | plus: 0)=30]
0.1) find / find_index / has on string arrays
find with numeric property (0, "alpha"): null
find_index with numeric property (0, "alpha"): null
has with numeric property (0, "alpha"): false
find substring-ish (property="alp", target="alp"): "alpha"
reject substring-ish (property="foo", target="foo"): ["alpha","beta","gamma","Alpha","ALPHA","123"]
0.2) reject on string arrays (indexing style)
reject first-char=="a" (property=0, target="a"): ["beta","gamma","Alpha","ALPHA","foo bar","foo_bar","123"]
find 1-arg (property="alp"): "alpha"
find_index 1-arg (property="alp"): 0
has 1-arg (property="alp"): true
where 1-arg (property="alp"): ["alpha"]
reject 1-arg (property="alp"): ["beta","gamma","Alpha","ALPHA","foo bar","foo_bar","123"]
1) Product + variants tests (uses first product from first collection if possible)
test_collection: Products
test_product: Gift Shoe
variants count: 9
1.1) find / find_index / has on variants (boolean + numbers)
find: "available", true => 40593385848878
find_index: "available", true => 0
has: "available", true => true
find: "inventory_quantity", 0 => 40593385947182
find_index: "inventory_quantity", 0 => 3
has: "inventory_quantity", 0 => true
1.2) reject on variants
reject: "available", true => remaining count: 6
reject: "inventory_quantity", 0 => remaining count: 3
1.3) string comparisons on variant options
first_variant.option1: "Black"
find: "option1", opt1 => 40593385848878
1.4) type mismatch tests (string "0" vs number 0)
find inventory_quantity == 0 (number) => 40593385947182
find inventory_quantity == "0" (string) => nil
has inventory_quantity == 0 (number) => true
has inventory_quantity == "0" (string) => false
1.5) object equality attempt (variant.product == test_product?)
find: "product", test_product => 40593385848878
2) Filters object tests (lightweight, guarded)
filters exists?: false
filters.size: n/a
first_filter.label: nil
3) Nested property string tests (metafields-ish dotted path)
dotted where: "metafields.custom.badge.value", "New" => size: 0
dotted find => nil
4) Empty input tests
empty array: ""
find on empty => null
find_index on empty => null
has on empty => false
reject on empty => [""]
5) Dot-path property argument tests (variant.product.handle)
Expected handle: gift-shoe
Product handle: gift-shoe
Baseline find: 'product', p => 40593385848878
Dot find: 'product.handle', handle => nil
Dot find_index => null
Dot has => false
Dot where size => 0
where: 'product', p => size: 9
where: 'product.handle', p.handle => size: 0
END FILTER TEST HARNESS