diff options
| -rw-r--r-- | kconfiglib.py | 6 | ||||
| -rw-r--r-- | tests/Kitemlists | 4 | ||||
| -rw-r--r-- | testsuite.py | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 700870d..d9af800 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2579,8 +2579,6 @@ class Kconfig(object): if self._peek_token() is None: choice = Choice() choice.direct_dep = self.n - - self.choices.append(choice) else: # Named choice name = self._expect_str_and_eol() @@ -2589,10 +2587,10 @@ class Kconfig(object): choice = Choice() choice.name = name choice.direct_dep = self.n - - self.choices.append(choice) self.named_choices[name] = choice + self.choices.append(choice) + choice.kconfig = self node = MenuNode() diff --git a/tests/Kitemlists b/tests/Kitemlists index fc72e5c..8aa7107 100644 --- a/tests/Kitemlists +++ b/tests/Kitemlists @@ -19,6 +19,10 @@ choice bool "choice 3" endchoice +choice NAMED + bool +endchoice + endmenu menu "menu 4" diff --git a/testsuite.py b/testsuite.py index c027189..782f3ed 100644 --- a/testsuite.py +++ b/testsuite.py @@ -1185,7 +1185,7 @@ tests/Krecursive2:1 "Wrong prompt for {}, expected '{}'" .format(repr(item), expected_prompt)) - verify_prompts(c.choices, "choice 1", "choice 2", "choice 3") + verify_prompts(c.choices, "choice 1", "choice 2", "choice 3", "choice 2") verify_prompts(c.menus, "menu 1", "menu 2", "menu 3", "menu 4", "menu 5") verify_prompts(c.comments, "comment 1", "comment 2", "comment 3") |
