diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-20 22:03:43 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-20 22:09:51 +0200 |
| commit | 2d391d8f369a40b438a1b246c888bb42b2e14278 (patch) | |
| tree | 726f594ef52eb8b32c12d488c54e2a3e35a6acbb | |
| parent | 52a099982ecb66eec1ae180f02fe58f2d9264078 (diff) | |
Fix detection of hex literals
Missing 'not'. Add some literals to the Kstrict testcase.
| -rw-r--r-- | kconfiglib.py | 2 | ||||
| -rw-r--r-- | tests/Kstrict | 7 | ||||
| -rw-r--r-- | testsuite.py | 6 |
3 files changed, 12 insertions, 3 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 988c319..e5db25c 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -5136,7 +5136,7 @@ def _is_num(s): try: int(s) except ValueError: - if s.startswith(("0x", "0X")): + if not s.startswith(("0x", "0X")): return False try: diff --git a/tests/Kstrict b/tests/Kstrict index 463a1c8..fae521a 100644 --- a/tests/Kstrict +++ b/tests/Kstrict @@ -8,6 +8,13 @@ config BOOL config INT int range UNDEF_2 8 + default 10 + range 5 15 + +config HEX + hex + range 0x123 0X456 + default 0x200 menu "menu" depends on UNDEF_1 diff --git a/testsuite.py b/testsuite.py index 150150c..58c85bb 100644 --- a/testsuite.py +++ b/testsuite.py @@ -2153,7 +2153,7 @@ config BOOL default UNDEF_2 -- Referenced at Kconfiglib/tests/Kstrict:12: +- Referenced at Kconfiglib/tests/Kstrict:19: menu "menu" depends on UNDEF_1 @@ -2174,10 +2174,12 @@ config BOOL config INT int range UNDEF_2 8 + range 5 15 + default 10 warning: undefined symbol UNDEF_3: -- Referenced at Kconfiglib/tests/Kstrict:12: +- Referenced at Kconfiglib/tests/Kstrict:19: menu "menu" depends on UNDEF_1 |
