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
13class TestCase(PExpectTest):
14
15    mydir = TestBase.compute_mydir(__file__)
16
17    # PExpect uses many timeouts internally and doesn't play well
18    # under ASAN on a loaded machine..
19    @skipIfAsan
20    @skipIf(oslist=["linux"], archs=["arm", "aarch64"]) # Randomly fails on buildbot
21    def test_unicode_input(self):
22        self.launch()
23
24        # Send some unicode input to LLDB.
25        # We should get back that this is an invalid command with our character as UTF-8.
26        self.expect(u'\u1234', substrs=[u"error: '\u1234' is not a valid command.".encode('utf-8')])
27
28        self.quit()
29