summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/data.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/tests/data.py')
-rw-r--r--bitbake/lib/bb/tests/data.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index a4a9dd30fb..8279115e03 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -281,7 +281,7 @@ class TestConcatOverride(unittest.TestCase):
281 def test_remove(self): 281 def test_remove(self):
282 self.d.setVar("TEST", "${VAL} ${BAR}") 282 self.d.setVar("TEST", "${VAL} ${BAR}")
283 self.d.setVar("TEST_remove", "val") 283 self.d.setVar("TEST_remove", "val")
284 self.assertEqual(self.d.getVar("TEST"), "bar") 284 self.assertEqual(self.d.getVar("TEST"), " bar")
285 285
286 def test_remove_cleared(self): 286 def test_remove_cleared(self):
287 self.d.setVar("TEST", "${VAL} ${BAR}") 287 self.d.setVar("TEST", "${VAL} ${BAR}")
@@ -300,7 +300,7 @@ class TestConcatOverride(unittest.TestCase):
300 self.d.setVar("TEST", "${VAL} ${BAR}") 300 self.d.setVar("TEST", "${VAL} ${BAR}")
301 self.d.setVar("TEST_remove", "val") 301 self.d.setVar("TEST_remove", "val")
302 self.d.setVar("TEST_TEST", "${TEST} ${TEST}") 302 self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
303 self.assertEqual(self.d.getVar("TEST_TEST"), "bar bar") 303 self.assertEqual(self.d.getVar("TEST_TEST"), " bar bar")
304 304
305 def test_empty_remove(self): 305 def test_empty_remove(self):
306 self.d.setVar("TEST", "") 306 self.d.setVar("TEST", "")
@@ -311,13 +311,25 @@ class TestConcatOverride(unittest.TestCase):
311 self.d.setVar("BAR", "Z") 311 self.d.setVar("BAR", "Z")
312 self.d.setVar("TEST", "${BAR}/X Y") 312 self.d.setVar("TEST", "${BAR}/X Y")
313 self.d.setVar("TEST_remove", "${BAR}/X") 313 self.d.setVar("TEST_remove", "${BAR}/X")
314 self.assertEqual(self.d.getVar("TEST"), "Y") 314 self.assertEqual(self.d.getVar("TEST"), " Y")
315 315
316 def test_remove_expansion_items(self): 316 def test_remove_expansion_items(self):
317 self.d.setVar("TEST", "A B C D") 317 self.d.setVar("TEST", "A B C D")
318 self.d.setVar("BAR", "B D") 318 self.d.setVar("BAR", "B D")
319 self.d.setVar("TEST_remove", "${BAR}") 319 self.d.setVar("TEST_remove", "${BAR}")
320 self.assertEqual(self.d.getVar("TEST"), "A C") 320 self.assertEqual(self.d.getVar("TEST"), "A C ")
321
322 def test_remove_preserve_whitespace(self):
323 # When the removal isn't active, the original value should be preserved
324 self.d.setVar("TEST", " A B")
325 self.d.setVar("TEST_remove", "C")
326 self.assertEqual(self.d.getVar("TEST"), " A B")
327
328 def test_remove_preserve_whitespace2(self):
329 # When the removal is active preserve the whitespace
330 self.d.setVar("TEST", " A B")
331 self.d.setVar("TEST_remove", "B")
332 self.assertEqual(self.d.getVar("TEST"), " A ")
321 333
322class TestOverrides(unittest.TestCase): 334class TestOverrides(unittest.TestCase):
323 def setUp(self): 335 def setUp(self):