Skip to content

Commit 1f58216

Browse files
committed
Add unit test mixing positional and kwargs arguments
1 parent d387951 commit 1f58216

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/unit/variable_unit_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ def test_rigid_filter_argument_parsing
184184
var = create_variable(%(n | filter: 1, 2, 3 | filter2: k1: 1, k2: 2))
185185
assert_equal([['filter', [1, 2, 3]], ['filter2', [], { "k1" => 1, "k2" => 2 }]], var.filters)
186186

187+
# positional and kwargs mixed
188+
var = create_variable(%(n | filter: 'a', 'b', key1: 1, key2: 2, 'c'))
189+
assert_equal([["filter", ["a", "b", "c"], { "key1" => 1, "key2" => 2 }]], var.filters)
190+
187191
# positional and kwargs intermixed (pos1, key1: val1, pos2)
188192
var = create_variable(%(n | link_to: class: "black", "https://example.com", title: "title"))
189193
assert_equal([['link_to', ["https://example.com"], { "class" => "black", "title" => "title" }]], var.filters)

0 commit comments

Comments
 (0)