Browse Source

fix(test): replace test_binary with a real binary file (#4285)

Berton Zhu 3 years ago
parent
commit
3a7cd28a7b
2 changed files with 2 additions and 8 deletions
  1. 2 8
      core/tauri/src/api/file.rs
  2. BIN
      core/tauri/test/api/test_binary

+ 2 - 8
core/tauri/src/api/file.rs

@@ -121,15 +121,9 @@ mod test {
   fn check_read_binary() {
     let file = String::from("test/api/test_binary");
 
-    #[cfg(windows)]
     let expected_vec = vec![
-      35, 33, 47, 98, 105, 110, 47, 98, 97, 115, 104, 13, 10, 13, 10, 101, 99, 104, 111, 32, 34,
-      72, 101, 108, 108, 111, 32, 116, 104, 101, 114, 101, 34,
-    ];
-    #[cfg(not(windows))]
-    let expected_vec = vec![
-      35, 33, 47, 98, 105, 110, 47, 98, 97, 115, 104, 10, 10, 101, 99, 104, 111, 32, 34, 72, 101,
-      108, 108, 111, 32, 116, 104, 101, 114, 101, 34,
+      71, 73, 70, 56, 57, 97, 1, 0, 1, 0, 128, 0, 0, 255, 255, 255, 0, 0, 0, 33, 249, 4, 1, 0, 0,
+      0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59,
     ];
 
     let res = read_binary(file);

BIN
core/tauri/test/api/test_binary