]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: Improve the error message for bad format chars
authorVolker Lendecke <vl@samba.org>
Thu, 5 Sep 2024 11:06:23 +0000 (13:06 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 10 Sep 2024 21:54:36 +0000 (21:54 +0000)
Print the faulty character for easier finding it.

I did not find out how to split the format string into two lines such
that self.fail would properly print the whole thing in its exception,
so we have a long line here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/tests/source_chars.py

index 46130888cbc078d659808d189cf4fdac3d79f005..dea7fcc98192161abf38618c823679efb1000779 100755 (executable)
@@ -241,7 +241,7 @@ class CharacterTests(TestCase):
             dirs = set()
             for c in set(s):
                 if is_bad_char(c):
-                    self.fail(f"{name} has potentially bad format characters!")
+                    self.fail(f"{name} has potentially bad format character {ord(c[0])}!")
                 dirs.add(u.bidirectional(c))
 
             if 'L' in dirs and 'R' in dirs: