summaryrefslogtreecommitdiff
path: root/testsuite.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2015-07-23 21:54:12 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2015-07-23 21:54:12 +0200
commite15304917c21fbc1d83b02e6ca2e9eb0c8f1963c (patch)
tree2e6cb620cfeea83e20bddb7197a0cadda909ff61 /testsuite.py
parent9fa6f3d58a7000c3cd501c60c12758781b002063 (diff)
Add .config header continuation line test.
Mostly to get coverage for _FileFeed.peek_next(), which is only used while reading the header. The tested behavior probably doesn't make much sense for .config files and stems from _FileFeed reuse. It's fairly obscure at least.
Diffstat (limited to 'testsuite.py')
-rw-r--r--testsuite.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite.py b/testsuite.py
index 6863bbb..e08743c 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -1519,6 +1519,19 @@ def run_selftests():
"Expected empty header in file with just '#', got '{0}'".
format(c.get_config_header()))
+ # TODO: Line joining (which stems from _FileFeed reuse) probably doesn't
+ # make sense within .config files. (The C implementation has no notion of
+ # continuation lines within .config files.) It's harmless except for fairly
+ # obscure cases though.
+ #
+ # Add a test for now just to get test coverage for _FileFeed.peek_next(),
+ # which is only used while reading .config files as of writing.
+
+ c.load_config("Kconfiglib/tests/config_continuation")
+ verify(c.get_config_header() ==
+ " Foo # Bar\n Baz # Foo # Bar\n Baz\n Foo",
+ "Continuation line handling within .config headers is broken")
+
# Appending values from a .config
c = kconfiglib.Config("Kconfiglib/tests/Kappend")