@@ -17,6 +17,7 @@ mod find_and_replace {
1717 "https://test.test/?fbclid=dsadsa&utm_source=fafa&utm_campaign=fafas&utm_medium=adsa" ,
1818 & ClinkConfig {
1919 mode: Mode :: Remove ,
20+ your_mom: "your_mom" . to_string( ) ,
2021 sleep_duration: 150 ,
2122 params: get_default_params( ) ,
2223 }
@@ -28,6 +29,7 @@ mod find_and_replace {
2829 "https://test.test/?fbclid=dsadsa&utm_source=fafa&utm_campaign=fafas&utm_medium=adsa" ,
2930 & ClinkConfig {
3031 mode: Mode :: YourMom ,
32+ your_mom: "your_mom" . to_string( ) ,
3133 sleep_duration: 150 ,
3234 params: get_default_params( )
3335 }
@@ -39,6 +41,7 @@ mod find_and_replace {
3941 "https://test.test/?fbclid=IwAR3l6qn8TzOT254dIa7jBAM1dG3OHn3f8ZoRGsADTmqG1Zfmmko-oRhE8Qs&utm_source=IwAR3l6qn8TzOT254dIa7jBAM1dG3OHn3f8ZoRGsADTmqG1Zfmmko-oRhE8Qs&utm_campaign=IwAR3l6qn8TzOT254dIa7jBAM1dG3OHn3f8ZoRGsADTmqG1Zfmmko-oRhE8Qs&utm_medium=IwAR3l6qn8TzOT254dIa7jBAM1dG3OHn3f8ZoRGsADTmqG1Zfmmko-oRhE8Qs" ,
4042 & ClinkConfig {
4143 mode: Mode :: Evil ,
44+ your_mom: "your_mom" . to_string( ) ,
4245 sleep_duration: 150 ,
4346 params: get_default_params( )
4447 }
@@ -53,6 +56,7 @@ mod find_and_replace {
5356 "https://test.test/?abc=abc" ,
5457 & ClinkConfig {
5558 mode: Mode :: Remove ,
59+ your_mom: "your_mom" . to_string( ) ,
5660 sleep_duration: 150 ,
5761 params: get_default_params( )
5862 }
@@ -64,6 +68,7 @@ mod find_and_replace {
6468 "https://test.test/?abc=abc" ,
6569 & ClinkConfig {
6670 mode: Mode :: YourMom ,
71+ your_mom: "your_mom" . to_string( ) ,
6772 sleep_duration: 150 ,
6873 params: get_default_params( )
6974 }
@@ -78,6 +83,7 @@ mod find_and_replace {
7883 "https://test.test/?abc=abc&fbclid=flksj" ,
7984 & ClinkConfig {
8085 mode: Mode :: Remove ,
86+ your_mom: "your_mom" . to_string( ) ,
8187 sleep_duration: 150 ,
8288 params: get_default_params( )
8389 }
@@ -89,6 +95,7 @@ mod find_and_replace {
8995 "https://test.test/?abc=abc&fbclid=flksj" ,
9096 & ClinkConfig {
9197 mode: Mode :: YourMom ,
98+ your_mom: "your_mom" . to_string( ) ,
9299 sleep_duration: 150 ,
93100 params: get_default_params( )
94101 }
@@ -103,6 +110,7 @@ mod find_and_replace {
103110 "https://test.test/?abc=abc&fbclid=flksj\n https://test.test/?abc=abc&fbclid=flksj" ,
104111 & ClinkConfig {
105112 mode: Mode :: Remove ,
113+ your_mom: "your_mom" . to_string( ) ,
106114 sleep_duration: 150 ,
107115 params: get_default_params( )
108116 }
@@ -114,6 +122,7 @@ mod find_and_replace {
114122 "https://test.test/?abc=abc&fbclid=flksj\n https://test.test/?abc=abc&fbclid=flksj" ,
115123 & ClinkConfig {
116124 mode: Mode :: YourMom ,
125+ your_mom: "your_mom" . to_string( ) ,
117126 sleep_duration: 150 ,
118127 params: get_default_params( )
119128 }
@@ -128,6 +137,7 @@ mod find_and_replace {
128137 "some text here https://test.test/?abc=abc&fbclid=flksj here \n and herehttps://test.test/?abc=abc&fbclid=flksj" ,
129138 & ClinkConfig {
130139 mode: Mode :: Remove ,
140+ your_mom: "your_mom" . to_string( ) ,
131141 sleep_duration: 150 ,
132142 params: get_default_params( )
133143 }
@@ -139,13 +149,45 @@ mod find_and_replace {
139149 "some text here https://test.test/?abc=abc&fbclid=flksj here \n and herehttps://test.test/?abc=abc&fbclid=flksj" ,
140150 & ClinkConfig {
141151 mode: Mode :: YourMom ,
152+ your_mom: "your_mom" . to_string( ) ,
142153 sleep_duration: 150 ,
143154 params: get_default_params( )
144155 }
145156 ) ,
146157 "some text here https://test.test/?abc=abc&fbclid=your_mom here \n and herehttps://test.test/?abc=abc&fbclid=your_mom"
147158 ) ;
148159 }
160+ #[ test]
161+ fn custom_text_for_your_mom_mode ( ) {
162+ assert_eq ! (
163+ find_and_replace(
164+ "https://test.test/?fbclid=dsadsa&utm_source=fafa&utm_campaign=fafas&utm_medium=adsa" ,
165+ & ClinkConfig {
166+ mode: Mode :: YourMom ,
167+ your_mom: "foo" . to_string( ) ,
168+ sleep_duration: 150 ,
169+ params: get_default_params( )
170+ }
171+ ) ,
172+ "https://test.test/?fbclid=foo&utm_source=foo&utm_campaign=foo&utm_medium=foo"
173+ ) ;
174+ }
175+
176+ #[ test]
177+ fn custom_params ( ) {
178+ assert_eq ! (
179+ find_and_replace(
180+ "https://test.test/?foo=dsadsa" ,
181+ & ClinkConfig {
182+ mode: Mode :: YourMom ,
183+ your_mom: "your_mom" . to_string( ) ,
184+ sleep_duration: 150 ,
185+ params: vec![ "foo" . to_string( ) ]
186+ }
187+ ) ,
188+ "https://test.test/?foo=your_mom"
189+ ) ;
190+ }
149191}
150192
151193pub fn find_and_replace ( str : & str , config : & ClinkConfig ) -> String {
@@ -184,7 +226,7 @@ fn process_query(
184226 Mode :: YourMom => query
185227 . map ( |p| {
186228 if is_hit ( & p. 0 , & index) {
187- ( p. 0 . to_string ( ) , " your_mom" . to_string ( ) )
229+ ( p. 0 . to_string ( ) , config . your_mom . clone ( ) )
188230 } else {
189231 ( p. 0 . to_string ( ) , p. 1 . to_string ( ) )
190232 }
0 commit comments