@@ -4,20 +4,18 @@ use cm;
44use html;
55#[ cfg( feature = "syntect" ) ]
66use plugins:: syntect:: SyntectAdapter ;
7- use propfuzz:: prelude:: * ;
87use std:: collections:: HashMap ;
9- use std:: fmt:: Debug ;
108use strings:: build_opening_tag;
119use timebomb:: timeout_ms;
12- use {
13- parse_document, Arena , ComrakExtensionOptions , ComrakOptions , ComrakParseOptions ,
14- ComrakPlugins , ComrakRenderOptions ,
15- } ;
1610
11+ #[ cfg( not( target_arch = "wasm32" ) ) ]
12+ use propfuzz:: prelude:: * ;
13+
14+ #[ cfg( not( target_arch = "wasm32" ) ) ]
1715#[ propfuzz]
1816fn fuzz_doesnt_crash ( md : String ) {
19- let options = ComrakOptions {
20- extension : ComrakExtensionOptions {
17+ let options = :: ComrakOptions {
18+ extension : :: ComrakExtensionOptions {
2119 strikethrough : true ,
2220 tagfilter : true ,
2321 table : true ,
@@ -29,11 +27,11 @@ fn fuzz_doesnt_crash(md: String) {
2927 description_lists : true ,
3028 front_matter_delimiter : None ,
3129 } ,
32- parse : ComrakParseOptions {
30+ parse : :: ComrakParseOptions {
3331 smart : true ,
3432 default_info_string : Some ( "Rust" . to_string ( ) ) ,
3533 } ,
36- render : ComrakRenderOptions {
34+ render : :: ComrakRenderOptions {
3735 hardbreaks : true ,
3836 github_pre_lang : true ,
3937 width : 80 ,
@@ -42,7 +40,7 @@ fn fuzz_doesnt_crash(md: String) {
4240 } ,
4341 } ;
4442
45- parse_document ( & Arena :: new ( ) , & md, & options) ;
43+ :: parse_document ( & :: Arena :: new ( ) , & md, & options) ;
4644}
4745
4846#[ track_caller]
@@ -71,20 +69,20 @@ fn html(input: &str, expected: &str) {
7169#[ track_caller]
7270fn html_opts < F > ( input : & str , expected : & str , opts : F )
7371where
74- F : Fn ( & mut ComrakOptions ) ,
72+ F : Fn ( & mut :: ComrakOptions ) ,
7573{
76- let arena = Arena :: new ( ) ;
77- let mut options = ComrakOptions :: default ( ) ;
74+ let arena = :: Arena :: new ( ) ;
75+ let mut options = :: ComrakOptions :: default ( ) ;
7876 opts ( & mut options) ;
7977
80- let root = parse_document ( & arena, input, & options) ;
78+ let root = :: parse_document ( & arena, input, & options) ;
8179 let mut output = vec ! [ ] ;
8280 html:: format_document ( root, & options, & mut output) . unwrap ( ) ;
8381 compare_strs ( & String :: from_utf8 ( output) . unwrap ( ) , expected, "regular" ) ;
8482
8583 let mut md = vec ! [ ] ;
8684 cm:: format_document ( root, & options, & mut md) . unwrap ( ) ;
87- let root = parse_document ( & arena, & String :: from_utf8 ( md) . unwrap ( ) , & options) ;
85+ let root = :: parse_document ( & arena, & String :: from_utf8 ( md) . unwrap ( ) , & options) ;
8886 let mut output_from_rt = vec ! [ ] ;
8987 html:: format_document ( root, & options, & mut output_from_rt) . unwrap ( ) ;
9088 compare_strs (
@@ -105,18 +103,18 @@ macro_rules! html_opts {
105103 } ;
106104}
107105
108- fn html_plugins ( input : & str , expected : & str , plugins : & ComrakPlugins ) {
109- let arena = Arena :: new ( ) ;
110- let options = ComrakOptions :: default ( ) ;
106+ fn html_plugins ( input : & str , expected : & str , plugins : & :: ComrakPlugins ) {
107+ let arena = :: Arena :: new ( ) ;
108+ let options = :: ComrakOptions :: default ( ) ;
111109
112- let root = parse_document ( & arena, input, & options) ;
110+ let root = :: parse_document ( & arena, input, & options) ;
113111 let mut output = vec ! [ ] ;
114112 html:: format_document_with_plugins ( root, & options, & mut output, & plugins) . unwrap ( ) ;
115113 compare_strs ( & String :: from_utf8 ( output) . unwrap ( ) , expected, "regular" ) ;
116114
117115 let mut md = vec ! [ ] ;
118116 cm:: format_document ( root, & options, & mut md) . unwrap ( ) ;
119- let root = parse_document ( & arena, & String :: from_utf8 ( md) . unwrap ( ) , & options) ;
117+ let root = :: parse_document ( & arena, & String :: from_utf8 ( md) . unwrap ( ) , & options) ;
120118 let mut output_from_rt = vec ! [ ] ;
121119 html:: format_document_with_plugins ( root, & options, & mut output_from_rt, & plugins) . unwrap ( ) ;
122120 compare_strs (
@@ -199,7 +197,7 @@ fn syntax_highlighter_plugin() {
199197 "</code></pre>\n "
200198 ) ;
201199
202- let mut plugins = ComrakPlugins :: default ( ) ;
200+ let mut plugins = :: ComrakPlugins :: default ( ) ;
203201 let adapter = MockAdapter { } ;
204202 plugins. render . codefence_syntax_highlighter = Some ( & adapter) ;
205203
@@ -219,7 +217,7 @@ fn syntect_plugin() {
219217 "</code></pre>\n "
220218 ) ;
221219
222- let mut plugins = ComrakPlugins :: default ( ) ;
220+ let mut plugins = :: ComrakPlugins :: default ( ) ;
223221 plugins. render . codefence_syntax_highlighter = Some ( & adapter) ;
224222
225223 html_plugins ( input, expected, & plugins) ;
@@ -425,9 +423,9 @@ fn blockquote_hard_linebreak_nonlazy_space() {
425423fn backticks_num ( ) {
426424 let input = "Some `code1`. More ``` code2 ```.\n " ;
427425
428- let arena = Arena :: new ( ) ;
429- let options = ComrakOptions :: default ( ) ;
430- let root = parse_document ( & arena, input, & options) ;
426+ let arena = :: Arena :: new ( ) ;
427+ let options = :: ComrakOptions :: default ( ) ;
428+ let root = :: parse_document ( & arena, input, & options) ;
431429
432430 let code1 = NodeValue :: Code ( NodeCode {
433431 num_backticks : 1 ,
@@ -1043,19 +1041,19 @@ fn nested_tables_3() {
10431041#[ test]
10441042fn no_stack_smash_html ( ) {
10451043 let s: String = :: std:: iter:: repeat ( '>' ) . take ( 150_000 ) . collect ( ) ;
1046- let arena = Arena :: new ( ) ;
1047- let root = parse_document ( & arena, & s, & ComrakOptions :: default ( ) ) ;
1044+ let arena = :: Arena :: new ( ) ;
1045+ let root = :: parse_document ( & arena, & s, & :: ComrakOptions :: default ( ) ) ;
10481046 let mut output = vec ! [ ] ;
1049- html:: format_document ( root, & ComrakOptions :: default ( ) , & mut output) . unwrap ( )
1047+ html:: format_document ( root, & :: ComrakOptions :: default ( ) , & mut output) . unwrap ( )
10501048}
10511049
10521050#[ test]
10531051fn no_stack_smash_cm ( ) {
10541052 let s: String = :: std:: iter:: repeat ( '>' ) . take ( 150_000 ) . collect ( ) ;
1055- let arena = Arena :: new ( ) ;
1056- let root = parse_document ( & arena, & s, & ComrakOptions :: default ( ) ) ;
1053+ let arena = :: Arena :: new ( ) ;
1054+ let root = :: parse_document ( & arena, & s, & :: ComrakOptions :: default ( ) ) ;
10571055 let mut output = vec ! [ ] ;
1058- cm:: format_document ( root, & ComrakOptions :: default ( ) , & mut output) . unwrap ( )
1056+ cm:: format_document ( root, & :: ComrakOptions :: default ( ) , & mut output) . unwrap ( )
10591057}
10601058
10611059#[ test]
0 commit comments