From 1f58216f48b5671fe25090d1cb251bb083cc3858 Mon Sep 17 00:00:00 2001 From: Guilherme Carreiro Date: Mon, 27 Oct 2025 12:14:09 +0100 Subject: [PATCH] Add unit test mixing positional and kwargs arguments --- test/unit/variable_unit_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/variable_unit_test.rb b/test/unit/variable_unit_test.rb index b46fc23f..cb3a6d8c 100644 --- a/test/unit/variable_unit_test.rb +++ b/test/unit/variable_unit_test.rb @@ -184,6 +184,10 @@ class VariableUnitTest < Minitest::Test var = create_variable(%(n | filter: 1, 2, 3 | filter2: k1: 1, k2: 2)) assert_equal([['filter', [1, 2, 3]], ['filter2', [], { "k1" => 1, "k2" => 2 }]], var.filters) + # positional and kwargs mixed + var = create_variable(%(n | filter: 'a', 'b', key1: 1, key2: 2, 'c')) + assert_equal([["filter", ["a", "b", "c"], { "key1" => 1, "key2" => 2 }]], var.filters) + # positional and kwargs intermixed (pos1, key1: val1, pos2) var = create_variable(%(n | link_to: class: "black", "https://example.com", title: "title")) assert_equal([['link_to', ["https://example.com"], { "class" => "black", "title" => "title" }]], var.filters)