File: fix-tests.patch

package info (click to toggle)
rust-yaml-rust2 0.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 604 kB
  • sloc: makefile: 2
file content (47 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- a/src/yaml.rs
+++ b/src/yaml.rs
@@ -839,8 +839,11 @@
 
 #[cfg(test)]
 mod test {
-    use super::{YAMLDecodingTrap, Yaml, YamlDecoder};
+    #[cfg(feature = "encoding")]
+    use super::{YAMLDecodingTrap, YamlDecoder};
+    use super::Yaml;
 
+    #[cfg(feature = "encoding")]
     #[test]
     fn test_read_bom() {
         let s = b"\xef\xbb\xbf---
@@ -856,6 +859,7 @@
         assert!(doc["d"][0].is_badvalue());
     }
 
+    #[cfg(feature = "encoding")]
     #[test]
     fn test_read_utf16le() {
         let s = b"\xff\xfe-\x00-\x00-\x00
@@ -872,6 +876,7 @@
         assert!(doc["d"][0].is_badvalue());
     }
 
+    #[cfg(feature = "encoding")]
     #[test]
     fn test_read_utf16be() {
         let s = b"\xfe\xff\x00-\x00-\x00-\x00
@@ -888,6 +893,7 @@
         assert!(doc["d"][0].is_badvalue());
     }
 
+    #[cfg(feature = "encoding")]
     #[test]
     fn test_read_utf16le_nobom() {
         let s = b"-\x00-\x00-\x00
@@ -904,6 +910,7 @@
         assert!(doc["d"][0].is_badvalue());
     }
 
+    #[cfg(feature = "encoding")]
     #[test]
     fn test_read_trap() {
         let s = b"---