diff --git a/config/robotframework_aio/release_items_JsonPreprocessor.json b/config/robotframework_aio/release_items_JsonPreprocessor.json index 6640d9e0..e26f3a94 100644 --- a/config/robotframework_aio/release_items_JsonPreprocessor.json +++ b/config/robotframework_aio/release_items_JsonPreprocessor.json @@ -60,6 +60,9 @@ * Improved format of nested parameters; improved error messages * Some bugs fixed in implicitly created data structures * Improved index handling together with nested parameters +* Self test extended by further test cases + + All JsonPreprocessor test cases: `JPP_TestUsecases.html `_ " ] } diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index 7cf077ad..25f68d66 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -70,6 +70,8 @@ JPP_0508|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string conc JPP_0509|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (different syntax) JPP_0510|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several parameter assignments in separate lines (extended string concatenation) JPP_0511|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a list; list index is defined by a parameter +JPP_0512|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression +JPP_0513|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes JPP_0550|COMPOSITE_EXPRESSIONS|BADCASE|JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside) JPP_0600|CODE_COMMENTS|GOODCASE|JSON file with several combinations of code comments JPP_0950|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (1) @@ -79,6 +81,7 @@ JPP_0953|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (4): file JPP_0954|COMMON_SYNTAX_VIOLATIONS|BADCASE|JSON file with syntax error (5): file is empty (multiple pairs of brackets only) JPP_1000|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly JPP_1001|IMPLICIT_CREATION|GOODCASE|JSON file with dictionary keys to be created implicitly (same key names at all levels) +JPP_1002|IMPLICIT_CREATION|GOODCASE|JSON file with combinations of implicit and explicit creation / with and without initialization JPP_1050|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (1) JPP_1051|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (2) JPP_1052|IMPLICIT_CREATION|BADCASE|JSON file with implicit creation of data structures based on parameters (3) diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index e844199b..ed772796 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -2373,6 +2373,72 @@ 71 + + + +JPP_0512 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +72 + + + + + +JPP_0513 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +73 + + @@ -2404,7 +2470,7 @@ -72 +74 @@ -2437,7 +2503,7 @@ -73 +75 @@ -2470,7 +2536,7 @@ -74 +76 @@ -2503,7 +2569,7 @@ -75 +77 @@ -2536,7 +2602,7 @@ -76 +78 @@ -2569,7 +2635,7 @@ -77 +79 @@ -2602,7 +2668,7 @@ -78 +80 @@ -2635,7 +2701,7 @@ -79 +81 @@ -2668,7 +2734,40 @@ -80 +82 + + + + + +JPP_1002 + + + + +IMPLICIT_CREATION + + + + +GOODCASE + + + + +JSON file with combinations of implicit and explicit creation / with and without initialization
+Expected: JsonPreprocessor returns values + + +
+ + + + + + + +83 @@ -2701,7 +2800,7 @@ -81 +84 @@ -2734,7 +2833,7 @@ -82 +85 @@ -2767,7 +2866,7 @@ -83 +86 @@ -2800,7 +2899,7 @@ -84 +87 @@ -2833,7 +2932,7 @@ -85 +88 @@ -2866,7 +2965,7 @@ -86 +89 @@ -2899,7 +2998,7 @@ -87 +90 @@ -2932,7 +3031,7 @@ -88 +91 @@ -2965,7 +3064,7 @@ -89 +92 @@ -2998,7 +3097,7 @@ -90 +93 @@ -3031,7 +3130,7 @@ -91 +94 @@ -3065,7 +3164,7 @@
 

-
Generated: 10.01.2024 - 12:25:22
+
Generated: 16.01.2024 - 13:22:08
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index 90d36826..b4213476 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -773,6 +773,26 @@ Test Use Cases ---- +* **Test JPP_0512** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression** + + Expected: JsonPreprocessor returns expected value + +---- + +* **Test JPP_0513** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes** + + Expected: JsonPreprocessor returns expected value + +---- + * **Test JPP_0550** [COMPOSITE_EXPRESSIONS / BADCASE] @@ -865,6 +885,16 @@ Test Use Cases ---- +* **Test JPP_1002** + + [IMPLICIT_CREATION / GOODCASE] + + **JSON file with combinations of implicit and explicit creation / with and without initialization** + + Expected: JsonPreprocessor returns values + +---- + * **Test JPP_1050** [IMPLICIT_CREATION / BADCASE] @@ -987,5 +1017,5 @@ Test Use Cases ---- -Generated: 10.01.2024 - 12:25:22 +Generated: 16.01.2024 - 13:22:08 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index b6015cb1..deea47d0 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -324,6 +324,14 @@ Test JPP_0511 / COMPOSITE_EXPRESSIONS / GOODCASE Description: JSON file containing a list; list index is defined by a parameter Expectation: JsonPreprocessor returns expected value ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0512 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0513 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ Test JPP_0550 / COMPOSITE_EXPRESSIONS / BADCASE Description: JSON file with composite data structure (nested lists and dictionaries / some key names with dots inside) Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -361,6 +369,10 @@ Test JPP_1001 / IMPLICIT_CREATION / GOODCASE Description: JSON file with dictionary keys to be created implicitly (same key names at all levels) Expectation: JsonPreprocessor returns values ------------------------------------------------------------------------------------------------------------------------ +Test JPP_1002 / IMPLICIT_CREATION / GOODCASE +Description: JSON file with combinations of implicit and explicit creation / with and without initialization +Expectation: JsonPreprocessor returns values +------------------------------------------------------------------------------------------------------------------------ Test JPP_1050 / IMPLICIT_CREATION / BADCASE Description: JSON file with implicit creation of data structures based on parameters (1) Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -410,5 +422,5 @@ Description: Relative path to JSON file Expectation: JsonPreprocessor resolves the relative path and returns values from JSON file Hint.......: Works with raw path to JSON file (path not normalized internally) ------------------------------------------------------------------------------------------------------------------------ -Generated: 10.01.2024 - 12:25:22 +Generated: 16.01.2024 - 13:22:08 diff --git a/test/component_test.py b/test/component_test.py index 634c513e..5340b917 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -22,8 +22,8 @@ # # -------------------------------------------------------------------------------------------------------------- # -VERSION = "0.22.0" -VERSION_DATE = "10.01.2024" +VERSION = "0.24.0" +VERSION_DATE = "16.01.2024" # # -------------------------------------------------------------------------------------------------------------- #TM*** diff --git a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py index f125caec..39b14554 100644 --- a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py +++ b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 09.01.2024 - 17:01:37 +# 15.01.2024 - 16:29:04 # # -------------------------------------------------------------------------------------------------------------- @@ -117,4 +117,20 @@ def test_JPP_0510(self, Description): def test_JPP_0511(self, Description): nReturn = CExecute.Execute("JPP_0511") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression",] + ) + def test_JPP_0512(self, Description): + nReturn = CExecute.Execute("JPP_0512") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes",] + ) + def test_JPP_0513(self, Description): + nReturn = CExecute.Execute("JPP_0513") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py b/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py index f093afa9..3e708064 100644 --- a/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py +++ b/test/pytest/pytestfiles/test_11_IMPLICIT_CREATION_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 16.01.2024 - 13:22:08 # # -------------------------------------------------------------------------------------------------------------- @@ -45,4 +45,12 @@ def test_JPP_1000(self, Description): def test_JPP_1001(self, Description): nReturn = CExecute.Execute("JPP_1001") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns values + @pytest.mark.parametrize( + "Description", ["JSON file with combinations of implicit and explicit creation / with and without initialization",] + ) + def test_JPP_1002(self, Description): + nReturn = CExecute.Execute("JPP_1002") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index b0dad3b3..6680eecc 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -22,7 +22,7 @@ # # -------------------------------------------------------------------------------------------------------------- # -# 09.01.2024 +# 16.01.2024 # # !!! Temporarily tests are deactivated by the following line commented out: # # # listofdictUsecases.append(dictUsecase) @@ -1292,7 +1292,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0268.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "List indices must be of type 'int' (error message placeholder)" dictUsecase['EXPECTEDRETURN'] = None -# # listofdictUsecases.append(dictUsecase) +# # # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -2020,6 +2020,64 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0512" +dictUsecase['DESCRIPTION'] = "JSON file containing a nested use of lists and dictionaries, with the same parameter used several times within the same expression" +dictUsecase['EXPECTATION'] = "JsonPreprocessor returns expected value" +dictUsecase['SECTION'] = "COMPOSITE_EXPRESSIONS" +dictUsecase['SUBSECTION'] = "GOODCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0512.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (4/1) > {dict_param} [DICT] (2/1) > {A} [INT] : 0 +[DICT] (4/1) > {dict_param} [DICT] (2/2) > {B} [INT] : 1 +[DICT] (4/2) > {list_param} [LIST] (2/1) > [STR] : 'A' +[DICT] (4/2) > {list_param} [LIST] (2/2) > [STR] : 'B' +[DICT] (4/3) > {param1} [STR] : 'A' +[DICT] (4/4) > {param2} [STR] : '0'""" +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_0513" +dictUsecase['DESCRIPTION'] = "JSON file containing several square bracket expressions (as list index and dictionary key) with and without single quotes" +dictUsecase['EXPECTATION'] = "JsonPreprocessor returns expected value" +dictUsecase['SECTION'] = "COMPOSITE_EXPRESSIONS" +dictUsecase['SUBSECTION'] = "GOODCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0513.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (21/1) > {intparam} [INT] : 0 +[DICT] (21/2) > {stringparam} [STR] : 'A' +[DICT] (21/3) > {listparam} [LIST] (2/1) > [STR] : 'C' +[DICT] (21/3) > {listparam} [LIST] (2/2) > [STR] : 'D' +[DICT] (21/4) > {dictparam} [DICT] (3/1) > {0} [INT] : 3 +[DICT] (21/4) > {dictparam} [DICT] (3/2) > {A} [INT] : 5 +[DICT] (21/4) > {dictparam} [DICT] (3/3) > {B} [INT] : 6 +[DICT] (21/5) > {val01} [STR] : 'A' +[DICT] (21/6) > {val02} [STR] : 'B' +[DICT] (21/7) > {val03} [INT] : 0 +[DICT] (21/8) > {val04} [INT] : 1 +[DICT] (21/9) > {val05} [INT] : 1 +[DICT] (21/10) > {val06} [INT] : 1 +[DICT] (21/11) > {val07} [STR] : 'A' +[DICT] (21/12) > {val08} [STR] : 'B' +[DICT] (21/13) > {val09} [STR] : '0' +[DICT] (21/14) > {val10} [STR] : '1' +[DICT] (21/15) > {val11} [STR] : '1' +[DICT] (21/16) > {val12} [STR] : '1' +[DICT] (21/17) > {C} [STR] : 'E' +[DICT] (21/18) > {D} [STR] : 'F' +[DICT] (21/19) > {3} [INT] : 3 +[DICT] (21/20) > {5} [INT] : 5 +[DICT] (21/21) > {6} [INT] : 6""" +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_0550" @@ -2046,7 +2104,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0551.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "List indices must be of type 'int' (error message placeholder)" dictUsecase['EXPECTEDRETURN'] = None -# # listofdictUsecases.append(dictUsecase) +# # # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -2060,7 +2118,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0552.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" dictUsecase['EXPECTEDRETURN'] = None -# # listofdictUsecases.append(dictUsecase) +# # # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -2074,7 +2132,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0553.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" dictUsecase['EXPECTEDRETURN'] = None -# # listofdictUsecases.append(dictUsecase) +# # # listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -2237,6 +2295,27 @@ listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- +dictUsecase = {} +dictUsecase['TESTID'] = "JPP_1002" +dictUsecase['DESCRIPTION'] = "JSON file with combinations of implicit and explicit creation / with and without initialization" +dictUsecase['EXPECTATION'] = "JsonPreprocessor returns values" +dictUsecase['SECTION'] = "IMPLICIT_CREATION" +dictUsecase['SUBSECTION'] = "GOODCASE" +dictUsecase['HINT'] = None +dictUsecase['COMMENT'] = None +dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_1002.jsonp" +dictUsecase['EXPECTEDEXCEPTION'] = None +dictUsecase['EXPECTEDRETURN'] = """ +[DICT] (5/1) > {testdict_1} [DICT] (1/1) > {subKey} [DICT] (1/1) > {subKey} [DICT] (1/1) > {paramA} [DICT] (1/1) > {A} [INT] : 1 +[DICT] (5/2) > {paramD} [STR] : 'D' +[DICT] (5/3) > {paramE} [STR] : 'E' +[DICT] (5/4) > {testdict_2} [DICT] (1/1) > {subKey} [DICT] (1/1) > {subKey} [DICT] (1/1) > {paramA} [DICT] (3/1) > {B} [INT] : 2 +[DICT] (5/4) > {testdict_2} [DICT] (1/1) > {subKey} [DICT] (1/1) > {subKey} [DICT] (1/1) > {paramA} [DICT] (3/2) > {paramB} [DICT] (1/1) > {C} [INT] : 3 +[DICT] (5/4) > {testdict_2} [DICT] (1/1) > {subKey} [DICT] (1/1) > {subKey} [DICT] (1/1) > {paramA} [DICT] (3/3) > {paramC} [DICT] (1/1) > {D} [INT] : 4 +[DICT] (5/5) > {testdict_3} [DICT] (1/1) > {paramD} [DICT] (1/1) > {paramE} [DICT] (1/1) > {paramD} [DICT] (1/1) > {E} [DICT] (1/1) > {F} [INT] : 6""" +listofdictUsecases.append(dictUsecase) +del dictUsecase +# -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} dictUsecase['TESTID'] = "JPP_1050" diff --git a/test/testfiles/jpp-test_config_0512.jsonp b/test/testfiles/jpp-test_config_0512.jsonp new file mode 100644 index 00000000..e34cf2c3 --- /dev/null +++ b/test/testfiles/jpp-test_config_0512.jsonp @@ -0,0 +1,21 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + "dict_param" : {"A" : 0 , "B" : 1}, + "list_param" : ["A", "B"], + "param1" : "${list_param}[${dict_param}[${list_param}[${dict_param}[${list_param}[${dict_param}[${list_param}[${dict_param}[${list_param}[0]]]]]]]]]", + "param2" : "${dict_param}[${list_param}[${dict_param}[${list_param}[${dict_param}[${list_param}[${dict_param}[${list_param}[${dict_param}['A']]]]]]]]]" +} + diff --git a/test/testfiles/jpp-test_config_0513.jsonp b/test/testfiles/jpp-test_config_0513.jsonp new file mode 100644 index 00000000..98437634 --- /dev/null +++ b/test/testfiles/jpp-test_config_0513.jsonp @@ -0,0 +1,51 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** +{ + // single quotes check + // + "intparam" : 0, + "stringparam" : "A", + "listparam" : ["A", "B"], + "dictparam" : {"0" : 0, "A" : 1, "B" : 2}, + // + "val01" : ${listparam}[${intparam}], + "val02" : ${listparam}[1], + "val03" : ${dictparam}['${intparam}'], + "val04" : ${dictparam}[${stringparam}], + "val05" : ${dictparam}['${stringparam}'], + "val06" : ${dictparam}['A'], + // + "val07" : "${listparam}[${intparam}]", + "val08" : "${listparam}[1]", + "val09" : "${dictparam}['${intparam}']", + "val10" : "${dictparam}[${stringparam}]", + "val11" : "${dictparam}['${stringparam}']", + "val12" : "${dictparam}['A']", + // + ${listparam}[${intparam}] : "C", + ${listparam}[1] : "D", + ${dictparam}['${intparam}'] : 3, + ${dictparam}[${stringparam}] : 4, + ${dictparam}['${stringparam}'] : 5, + ${dictparam}['B'] : 6, + // + "${listparam}[${intparam}]" : "E", + "${listparam}[1]" : "F", + "${dictparam}['${intparam}']" : 3, + "${dictparam}[${stringparam}]" : 4, + "${dictparam}['${stringparam}']" : 5, + "${dictparam}['B']" : 6 +} + diff --git a/test/testfiles/jpp-test_config_1002.jsonp b/test/testfiles/jpp-test_config_1002.jsonp new file mode 100644 index 00000000..fe94987c --- /dev/null +++ b/test/testfiles/jpp-test_config_1002.jsonp @@ -0,0 +1,40 @@ +// Copyright 2020-2023 Robert Bosch GmbH +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//************************************************************************** + +{ + // with initialization at top level + "testdict_1" : {}, + ${testdict_1.subKey.subKey.paramA} : {"A" : 1}, + // + // without initialization at top level + ${testdict_2.subKey.subKey.paramA} : {"B" : 2}, + // + // already existing data structure extended (dotdict syntax) + ${testdict_2.subKey.subKey.paramA.paramB} : {"C" : 3}, + // + // already existing data structure extended (standard syntax) + ${testdict_2.subKey.subKey.paramA}['paramC'] : {"D" : 4}, + // + // parameters with name of a key must not interfere the implicit creation + "paramD" : "D", + "paramE" : "E", + ${testdict_3.paramD.paramE.paramD} : {"E" : 5}, + ${testdict_3.paramD.paramE.paramD}[${paramE}] : {"F" : 6} // if not implicit, usage of parameters for key names is allowed + // + // needs to be clarified (currently throws an implicit creation error) + // ${testdict_4} : {}, + // ${testdict_4}[${paramD}] : {"G" : 7} +} +