diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2019-06-24 08:18:06 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2019-06-24 08:57:38 +0200 |
| commit | 0ca8e78ebaed9ded586162753e8224f8ce7ef4a2 (patch) | |
| tree | 8eff8d2e6576dba8e6de109084a950ef085f59b9 /testsuite.py | |
| parent | 277c43348b65d8f6a4fb16c66fd48e9c697661e9 (diff) | |
Add {Symbol,Choice}.orig_*, corresponding to the MenuNode fields
Getting defaults, select, implies, and ranges without dependencies
propagated to conditions can be useful for symbols and choices as well,
e.g. when generating standalone documentation for properties.
Diffstat (limited to 'testsuite.py')
| -rw-r--r-- | testsuite.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/testsuite.py b/testsuite.py index 4bb1991..d5f9726 100644 --- a/testsuite.py +++ b/testsuite.py @@ -782,10 +782,10 @@ comment "advanced comment" """) - print("Testing MenuNode.orig_*") + print("Testing {MenuNode,Symbol,Choice}.orig_*") - # Just test some corner cases here. These are already tested above. Use - # MenuNode.__str__() as a proxy. + # Just test some corner cases here re. MenuNode.orig_*. They are already + # indirectly tested above. Use MenuNode.__str__() as a proxy. verify_str(c.syms["DEP_REM_CORNER_CASES"], """ config DEP_REM_CORNER_CASES @@ -823,6 +823,18 @@ config DEP_REM_CORNER_CASES depends on BAZ && QAZ """) + # Test {Symbol,Choice}.orig_* + + def verify_deps(elms, dep_index, expected): + verify_equal(" ".join(expr_str(elm[dep_index]) for elm in elms), + expected) + + verify_deps(c.syms["BOOL_SYM_ORIG"].orig_defaults, 1, "DEP y y") + verify_deps(c.syms["BOOL_SYM_ORIG"].orig_selects, 1, "y DEP y") + verify_deps(c.syms["BOOL_SYM_ORIG"].orig_implies, 1, "y y DEP") + verify_deps(c.syms["INT_SYM_ORIG"].orig_ranges, 2, "DEP y DEP") + verify_deps(c.named_choices["CHOICE_ORIG"].orig_defaults, 1, "y DEP DEP") + print("Testing Symbol.__repr__()") |
