Skip to content

Commit f54992a

Browse files
committed
add test for failing description
1 parent 7db9914 commit f54992a

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
OBJC_SOURCES := main.m
2+
LD_EXTRAS := -lobjc -framework Foundation
3+
include Makefile.rules
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import lldb
2+
from lldbsuite.test.decorators import *
3+
from lldbsuite.test.lldbtest import *
4+
from lldbsuite.test import lldbutil
5+
6+
7+
class TestCase(TestBase):
8+
def test(self):
9+
self.build()
10+
lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))
11+
self.expect(
12+
"expr -O -- bad", substrs=["error:", "expression interrupted", "(Bad *) 0x"]
13+
)
14+
self.expect(
15+
"dwim-print -O -- bad",
16+
substrs=["error:", "expression interrupted", "_lookHere = NO"],
17+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#import <Foundation/Foundation.h>
2+
3+
@interface Bad : NSObject
4+
@end
5+
6+
@implementation Bad {
7+
BOOL _lookHere;
8+
}
9+
10+
- (NSString *)description {
11+
int *i = NULL;
12+
*i = 0;
13+
return @"surprise";
14+
}
15+
@end
16+
17+
int main() {
18+
Bad *bad = [Bad new];
19+
printf("break here\n");
20+
return 0;
21+
}

0 commit comments

Comments
 (0)