From f7a8a460f626f399e4fd02c2eee112542e568392 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 18 Mar 2021 11:31:17 +0200 Subject: [PATCH] v.parser: add a test for db46ad5 --- ...calling_module_functions_with_maps_of_arrays_test.v | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 vlib/v/tests/calling_module_functions_with_maps_of_arrays_test.v diff --git a/vlib/v/tests/calling_module_functions_with_maps_of_arrays_test.v b/vlib/v/tests/calling_module_functions_with_maps_of_arrays_test.v new file mode 100644 index 0000000000..e515d22092 --- /dev/null +++ b/vlib/v/tests/calling_module_functions_with_maps_of_arrays_test.v @@ -0,0 +1,10 @@ +import json + +fn test_calling_functions_with_map_initializations_containing_arrays() { + result := json.encode(map{ + // NB: []string{} should NOT be treated as []json.string{} + 'users': []string{} + 'groups': []string{} + }) + assert result == '{"users":[],"groups":[]}' +}