xref: /llvm-project/lldb/test/API/lang/cpp/bool/TestCPPBool.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2Tests that bool types work
3"""
4import lldb
5from lldbsuite.test.lldbtest import *
6import lldbsuite.test.lldbutil as lldbutil
7
8
9class CPPBoolTestCase(TestBase):
10    def test_with_run_command(self):
11        """Test that bool types work in the expression parser"""
12        self.build()
13        lldbutil.run_to_source_breakpoint(
14            self, "// breakpoint 1", lldb.SBFileSpec("main.cpp")
15        )
16
17        self.expect_expr(
18            "bool second_bool = my_bool; second_bool",
19            result_type="bool",
20            result_value="false",
21        )
22        self.expect_expr("my_bool = true", result_type="bool", result_value="true")
23