@@ -68,12 +68,12 @@ mod tests {
6868 }
6969 }
7070
71- #[ test]
72- fn test_yaml ( ) {
73- println ! ( "{}" , std:: env:: current_dir( ) . unwrap( ) . to_str( ) . unwrap( ) ) ;
74- let mut clash = control:: Clash :: default ( ) ;
75- clash. change_config ( true , true , true , true ) ;
76- }
71+ // #[test]
72+ // fn test_yaml() {
73+ // println!("{}", std::env::current_dir().unwrap().to_str().unwrap());
74+ // let mut clash = control::Clash::default();
75+ // clash.change_config(true, true, true, true);
76+ // }
7777
7878 #[ test]
7979 fn regex_test ( ) {
@@ -167,60 +167,60 @@ mod tests {
167167 auto-detect-interface: true
168168 " ;
169169
170- let dns_config = match helper:: is_resolve_running ( ) {
171- true => {
172- "
173- enable: true
174- listen: 0.0.0.0:5354
175- enhanced-mode: fake-ip
176- fake-ip-range: 198.18.0.1/16
177- nameserver:
178- - https://doh.pub/dns-query
179- - https://dns.alidns.com/dns-query
180- - '114.114.114.114'
181- - '223.5.5.5'
182- default-nameserver:
183- - 119.29.29.29
184- - 223.5.5.5
185- fallback:
186- - https://1.1.1.1/dns-query
187- - https://dns.google/dns-query
188- - https://doh.opendns.com/dns-query
189- - https://doh.pub/dns-query
190- fallback-filter:
191- geoip: true
192- geoip-code: CN
193- ipcidr:
194- - 240.0.0.0/4
195- "
196- }
197- false => {
198- "
199- enable: true
200- listen: 0.0.0.0:53
201- enhanced-mode: fake-ip
202- fake-ip-range: 198.18.0.1/16
203- nameserver:
204- - https://doh.pub/dns-query
205- - https://dns.alidns.com/dns-query
206- - '114.114.114.114'
207- - '223.5.5.5'
208- default-nameserver:
209- - 119.29.29.29
210- - 223.5.5.5
211- fallback:
212- - https://1.1.1.1/dns-query
213- - https://dns.google/dns-query
214- - https://doh.opendns.com/dns-query
215- - https://doh.pub/dns-query
216- fallback-filter:
217- geoip: true
218- geoip-code: CN
219- ipcidr:
220- - 240.0.0.0/4
221- "
222- }
223- } ;
170+ // let dns_config = match helper::is_resolve_running() {
171+ // true => {
172+ // "
173+ // enable: true
174+ // listen: 0.0.0.0:5354
175+ // enhanced-mode: fake-ip
176+ // fake-ip-range: 198.18.0.1/16
177+ // nameserver:
178+ // - https://doh.pub/dns-query
179+ // - https://dns.alidns.com/dns-query
180+ // - '114.114.114.114'
181+ // - '223.5.5.5'
182+ // default-nameserver:
183+ // - 119.29.29.29
184+ // - 223.5.5.5
185+ // fallback:
186+ // - https://1.1.1.1/dns-query
187+ // - https://dns.google/dns-query
188+ // - https://doh.opendns.com/dns-query
189+ // - https://doh.pub/dns-query
190+ // fallback-filter:
191+ // geoip: true
192+ // geoip-code: CN
193+ // ipcidr:
194+ // - 240.0.0.0/4
195+ // "
196+ // }
197+ // false => {
198+ // "
199+ // enable: true
200+ // listen: 0.0.0.0:53
201+ // enhanced-mode: fake-ip
202+ // fake-ip-range: 198.18.0.1/16
203+ // nameserver:
204+ // - https://doh.pub/dns-query
205+ // - https://dns.alidns.com/dns-query
206+ // - '114.114.114.114'
207+ // - '223.5.5.5'
208+ // default-nameserver:
209+ // - 119.29.29.29
210+ // - 223.5.5.5
211+ // fallback:
212+ // - https://1.1.1.1/dns-query
213+ // - https://dns.google/dns-query
214+ // - https://doh.opendns.com/dns-query
215+ // - https://doh.pub/dns-query
216+ // fallback-filter:
217+ // geoip: true
218+ // geoip-code: CN
219+ // ipcidr:
220+ // - 240.0.0.0/4
221+ // "
222+ // }
223+ // };
224224
225225 //部分配置来自 https://www.xkww3n.cyou/2022/02/08/use-clash-dns-anti-dns-hijacking/
226226
@@ -240,16 +240,16 @@ mod tests {
240240 }
241241 }
242242
243- match yaml. get ( "dns" ) {
244- Some ( _) => {
245- //删除 DNS 配置
246- yaml. remove ( "dns" ) . unwrap ( ) ;
247- insert_config ( yaml, dns_config, "dns" ) ;
248- }
249- None => {
250- insert_config ( yaml, dns_config, "dns" ) ;
251- }
252- }
243+ // match yaml.get("dns") {
244+ // Some(_) => {
245+ // //删除 DNS 配置
246+ // yaml.remove("dns").unwrap();
247+ // insert_config(yaml, dns_config, "dns");
248+ // }
249+ // None => {
250+ // insert_config(yaml, dns_config, "dns");
251+ // }
252+ // }
253253
254254 let yaml_str = serde_yaml:: to_string ( & yaml) . unwrap ( ) ;
255255 fs:: write ( "./bin/config.new.yaml" , yaml_str) . unwrap ( ) ;
0 commit comments