about summary refs log tree commit diff
path: root/src/parser.rs
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi <fredmanglis@gmail.com>2022-08-06 07:48:35 +0300
committerFrederick Muriuki Muriithi <fredmanglis@gmail.com>2022-08-06 07:48:35 +0300
commit3492daa8ee40ca7dc1e90f232f458fdc5748b72d (patch)
tree7dbbdf9752e13b93be63b5d813b45940dd270795 /src/parser.rs
parent809a26505b5ceaf488151ba859f1a986d757b582 (diff)
downloadcorrelation_rust-3492daa8ee40ca7dc1e90f232f458fdc5748b72d.tar.gz
Fix tests
- Eliminate hard-coded absolute paths from the tests and replace them
  with relative paths
- Update tests where data formats have changed
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 2e263f8..0a2416a 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -1,5 +1,4 @@
 use serde::Deserialize;
-use std::fs::File;
 use std::io::Read;
 #[derive(Debug, Deserialize, PartialEq)]
 //#[serde(rename_all = "PascalCase")]
@@ -158,9 +157,10 @@ mod tests {
     #[test]
     fn test_json_file_read() {
         let json_struct =
-            JsonData::new("/home/kabui/correlation_rust/tests/data/sample_json_file.json");
+            JsonData::new("tests/data/sample_json_file.json");
 
-        let k = JsonData { file_path: String::from("/home/kabui/correlation_rust/tests/data/matrix_80.txt"),output_file:String::from("/home/kabui/correlation_rust/output.txt"),x_vals: String::from("25.08439, 72.02225, 47.56293, 22.87893, 14.28721, 71.84655, 87.81991, 84.86824, 6.72478, 5.72373, 73.47078, 63.74703"), sample_values: String::from("bxd1"),method:String::from("pearson"),file_delimiter:','};
+        let k = JsonData {
+	    file_path: String::from("tests/data/db300.txt"),output_file:String::from("output.txt"),x_vals: vec![25.08439, 72.02225, 47.56293, 22.87893, 14.28721, 71.84655, 87.81991, 84.86824, 6.72478, 5.72373, 73.47078, 63.74703],sample_values: String::from("bxd1"),method:String::from("pearson"),file_delimiter:','};
 
         assert_eq!(k, json_struct)
     }