Christian Boltz
4c77f7193b
Use parse() instead of _parse() in LogprofHeaderTest
...
The *LogprofHeaderTest accidently used the private _parse() insteaf of
the official parse().
2021-03-07 18:28:27 +01:00
Christian Boltz
d19735340a
Detect invalid trailing commas in variable definitions
...
Trailing commas in variable values are not allowed (unless they are
quoted). Fix the regex to avoid "eating" the comma, and add a check to
detect invalid commas.
As usual, add some tests, and remove some testcases from the
exception_not_raised list.
2020-05-27 13:32:44 +02:00
Christian Boltz
0629215f2a
Check for variable names not ending with }
...
... and add a test to ensure that everything works as expected.
Note that broken variable names like '@{foo' match the (quite
permissive) regex, but are invalid nevertheless.
2020-05-27 13:32:44 +02:00
Christian Boltz
6155b356b3
VariableRuleset: add get_merged_variables()
...
This function returns a dict with variables, both definitions (=) and
value additions (+=).
Also add some tests.
2020-05-27 13:32:44 +02:00
Christian Boltz
61db5595aa
VariableRuleset: Prevent re-defining variables
...
When adding a variable with a name that is already known to the
VariableRuleset, raise an exception.
Also add a test for this.
2020-05-27 13:32:43 +02:00
Christian Boltz
39eb1939ba
Split variables
...
... and enable tests related to this
2020-05-27 13:32:43 +02:00
Christian Boltz
1eb9791ed7
move separate_vars() from aa.py to VariableRule
...
... and also move its tests to test-variable.py
2020-05-27 13:32:43 +02:00
Christian Boltz
215ec38ae3
Add VariableRule and VariableRuleset
...
... and a set of tests for them.
Note that the tests include some TODOs, these will be handled in the
following commits.
2020-05-27 13:32:43 +02:00