Test passes if the two boxes below look exactly the same.

Key to entities used below: א - The Hebrew letter Alef (strongly RTL). ‭ - The LRO (left-to-right override) formatting character. ‬ - The PDF (pop directional formatting) formatting character; closes LRO.
א a! 1
a א! 1
‭1 a! א‬
‭a !א 1‬