summaryrefslogtreecommitdiffstats
path: root/testdata/source-chars-bidi.py
diff options
context:
space:
mode:
Diffstat (limited to 'testdata/source-chars-bidi.py')
-rw-r--r--testdata/source-chars-bidi.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/testdata/source-chars-bidi.py b/testdata/source-chars-bidi.py
new file mode 100644
index 0000000..d728da5
--- /dev/null
+++ b/testdata/source-chars-bidi.py
@@ -0,0 +1,24 @@
+# Used in samba.tests.source_chars to ensure bi-directional text is
+# caught. (make test TESTS=samba.tests.source_chars)
+
+x = א =2
+ח = n = 3
+
+a = x # 2 * n * m
+b = א # 2 * ח * m
+c = "x#" # n
+d = "א#" # ח
+e = f"x{x}n{n}"
+f = f"א{א}ח{ח}"
+
+print(a)
+print(b)
+print(c)
+print(d)
+print(e)
+print(f)
+
+assert a == b
+assert c == d.replace("א", "x")
+assert e[1] == f[1]
+assert e[3] == f[3]