11
11
# this would be a problem. If it is, it's a simple matter of changing this.
12
12
PANEL_NAME = 'exec'
13
13
14
+ # Pattern used for finding location of panics in test output.
15
+ #
16
+ # Rust 1.73 changed the formatting of a panic message.
17
+ # Older versions looked like:
18
+ # thread 'basic_error1' panicked at 'assertion failed: false', tests/test_test_output.rs:9:5
19
+ # 1.73 changed it to look like:
20
+ # thread 'basic_error1' panicked at tests/test_test_output.rs:9:5:
21
+ # assertion failed: false
22
+ PANIC_PATTERN = r'(?:, |panicked at )([^,<\n]*\.[A-z]{2}):([0-9]+)'
14
23
15
24
def create_output_panel (window , base_dir ):
16
25
output_view = window .create_output_panel (PANEL_NAME )
@@ -21,8 +30,7 @@ def create_output_panel(window, base_dir):
21
30
s .set ('result_file_regex' , '^[^:]+: (..[^:]*):([0-9]+): (.*)$' )
22
31
else :
23
32
build_pattern = '^[ \\ t]*-->[ \\ t]*([^<\n ]*):([0-9]+):([0-9]+)'
24
- test_pattern = ', ([^,<\n ]*\\ .[A-z]{2}):([0-9]+)'
25
- pattern = '(?|%s|%s)' % (build_pattern , test_pattern )
33
+ pattern = '(?|%s|%s)' % (build_pattern , PANIC_PATTERN )
26
34
s .set ('result_file_regex' , pattern )
27
35
# Used for resolving relative paths.
28
36
s .set ('result_base_dir' , base_dir )
@@ -76,8 +84,9 @@ def on_data(self, proc, data):
76
84
# Re-fetch the data to handle things like \t expansion.
77
85
appended = self .output_view .substr (
78
86
sublime .Region (region_start , self .output_view .size ()))
79
- m = re .search (r', ([^,<\n]*\.[A-z]{2}):([0-9]+):([0-9]+)' ,
80
- appended )
87
+ # This pattern also includes column numbers (which Sublime's
88
+ # result_file_regex doesn't support).
89
+ m = re .search (PANIC_PATTERN + r':([0-9]+)' , appended )
81
90
if m :
82
91
path = os .path .join (self .base_path , m .group (1 ))
83
92
if not os .path .exists (path ):
0 commit comments