File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -123,3 +123,28 @@ impl Parser for CommentParser {
123
123
self . inner . parse ( source)
124
124
}
125
125
}
126
+
127
+ #[ cfg( test) ]
128
+ mod tests {
129
+ use super :: CommentParser ;
130
+ use harper_core:: parsers:: { MarkdownOptions , StrParser } ;
131
+
132
+ #[ test]
133
+ fn hang ( ) {
134
+ use std:: sync:: mpsc:: channel;
135
+ use std:: thread;
136
+ use std:: time:: Duration ;
137
+
138
+ let ( tx, rx) = channel :: < ( ) > ( ) ;
139
+
140
+ let handle = thread:: spawn ( move || {
141
+ let opts = MarkdownOptions :: default ( ) ;
142
+ let parser = CommentParser :: new_from_language_id ( "java" , opts) . unwrap ( ) ;
143
+ let _res = parser. parse_str ( "//{@j" ) ;
144
+ tx. send ( ( ) ) . expect ( "send failed" ) ;
145
+ } ) ;
146
+
147
+ rx. recv_timeout ( Duration :: from_secs ( 10 ) ) . expect ( "timed out" ) ;
148
+ handle. join ( ) . expect ( "failed to join" ) ;
149
+ }
150
+ }
Original file line number Diff line number Diff line change @@ -567,4 +567,12 @@ Paragraph.
567
567
let parser = Markdown :: new ( opts) ;
568
568
let _res = parser. parse_str ( "[[#|]]:A]" ) ;
569
569
}
570
+
571
+ #[ test]
572
+ fn hang2 ( ) {
573
+ // This seems to only be a java specific problem...
574
+ let opts = MarkdownOptions :: default ( ) ;
575
+ let parser = Markdown :: new ( opts) ;
576
+ let _res = parser. parse_str ( "//{@j" ) ;
577
+ }
570
578
}
You can’t perform that action at this time.
0 commit comments