File: TestSessionHistory.py

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (111 lines) | stat: -rw-r--r-- 3,567 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
"""
Test the session history command
"""


import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class SessionHistoryTestCase(TestBase):
    @no_debug_info_test
    def test_history(self):
        self.runCmd("session history --clear", inHistory=False)
        self.runCmd("breakpoint list", check=False, inHistory=True)  # 0
        self.runCmd("register read", check=False, inHistory=True)  # 1
        self.runCmd("apropos hello", check=False, inHistory=True)  # 2
        self.runCmd("memory write", check=False, inHistory=True)  # 3
        self.runCmd("log list", check=False, inHistory=True)  # 4
        self.runCmd("disassemble", check=False, inHistory=True)  # 5
        self.runCmd("expression 1", check=False, inHistory=True)  # 6
        self.runCmd("type summary list -w default", check=False, inHistory=True)  # 7
        self.runCmd("version", check=False, inHistory=True)  # 8
        self.runCmd("frame select 1", check=False, inHistory=True)  # 9

        self.expect(
            "session history -s 3 -c 3",
            inHistory=True,
            substrs=["3: memory write", "4: log list", "5: disassemble"],
        )

        self.expect(
            "session history -s 3 -e 3", inHistory=True, substrs=["3: memory write"]
        )

        self.expect(
            "session history -s 6 -e 7",
            inHistory=True,
            substrs=["6: expression 1", "7: type summary list -w default"],
        )

        self.expect(
            "session history -c 2",
            inHistory=True,
            substrs=["0: breakpoint list", "1: register read"],
        )

        self.expect(
            "session history -e 3 -c 1", inHistory=True, substrs=["3: memory write"]
        )

        self.expect(
            "session history -e 2",
            inHistory=True,
            substrs=["0: breakpoint list", "1: register read", "2: apropos hello"],
        )

        self.expect(
            "session history -s 12",
            inHistory=True,
            substrs=[
                "12: session history -s 6 -e 7",
                "13: session history -c 2",
                "14: session history -e 3 -c 1",
                "15: session history -e 2",
                "16: session history -s 12",
            ],
        )

        self.expect(
            "session history -s end -c 3",
            inHistory=True,
            substrs=[
                "15: session history -e 2",
                "16: session history -s 12",
                "17: session history -s end -c 3",
            ],
        )

        self.expect(
            "session history -s end -e 15",
            inHistory=True,
            substrs=[
                "15: session history -e 2",
                "16: session history -s 12",
                "17: session history -s end -c 3",
                "session history -s end -e 15",
            ],
        )

        self.expect(
            "session history -s 5 -c 1", inHistory=True, substrs=["5: disassemble"]
        )

        self.expect(
            "session history -c 1 -s 5", inHistory=True, substrs=["5: disassemble"]
        )

        self.expect(
            "session history -c 1 -e 3", inHistory=True, substrs=["3: memory write"]
        )

        self.expect(
            "session history -c 1 -e 3 -s 5",
            error=True,
            inHistory=True,
            substrs=[
                "error: --count, --start-index and --end-index cannot be all specified in the same invocation"
            ],
        )