xref: /llvm-project/lldb/test/API/iohandler/unicode/TestUnicode.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1# -*- coding: utf-8 -*-
2"""
3Test unicode handling in LLDB.
4"""
5
6import os
7
8import lldb
9from lldbsuite.test.decorators import *
10from lldbsuite.test.lldbtest import *
11from lldbsuite.test.lldbpexpect import PExpectTest
12
13
14class TestCase(PExpectTest):
15    # PExpect uses many timeouts internally and doesn't play well
16    # under ASAN on a loaded machine..
17    @skipIfAsan
18    @skipIf(oslist=["linux"], archs=["arm", "aarch64"])  # Randomly fails on buildbot
19    def test_unicode_input(self):
20        self.launch()
21
22        # Send some unicode input to LLDB.
23        # We should get back that this is an invalid command with our character as UTF-8.
24        self.expect(
25            "\u1234",
26            substrs=["error: '\u1234' is not a valid command.".encode("utf-8")],
27        )
28
29        self.quit()
30