From 0df4918f2d88fc6d6af93f95f58bd963099a4d69 Mon Sep 17 00:00:00 2001 From: Joseph Crail Date: Thu, 4 Jun 2015 13:57:17 -0400 Subject: [PATCH] Fix split tests. I added an additional regex dependency and converted strings to Vec's for the assertions. --- src/split/deps.mk | 2 +- test/split.rs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/split/deps.mk b/src/split/deps.mk index 57031236f..40f6c5135 100644 --- a/src/split/deps.mk +++ b/src/split/deps.mk @@ -1 +1 @@ -DEPLIBS += rand regex +DEPLIBS += rand regex regex-syntax diff --git a/test/split.rs b/test/split.rs index baf75fbca..2af788078 100644 --- a/test/split.rs +++ b/test/split.rs @@ -1,5 +1,6 @@ extern crate libc; extern crate rand; +extern crate regex_syntax; extern crate regex; use std::fs::{File, read_dir, remove_file}; @@ -50,7 +51,7 @@ impl Glob { files.sort(); let mut data: Vec = vec!(); for name in files.iter() { - data.extend(get_file_contents(name)); + data.extend(get_file_contents(name).into_bytes()); } data } @@ -100,7 +101,7 @@ fn test_split_default() { panic!(); } assert_eq!(glob.count(), 2); - assert_eq!(glob.collate(), get_file_contents(name)); + assert_eq!(glob.collate(), get_file_contents(name).into_bytes()); glob.remove_all(); } @@ -113,7 +114,7 @@ fn test_split_num_prefixed_chunks_by_bytes() { panic!(); } assert_eq!(glob.count(), 10); - assert_eq!(glob.collate(), get_file_contents(name)); + assert_eq!(glob.collate(), get_file_contents(name).into_bytes()); glob.remove_all(); } @@ -126,7 +127,7 @@ fn test_split_str_prefixed_chunks_by_bytes() { panic!(); } assert_eq!(glob.count(), 10); - assert_eq!(glob.collate(), get_file_contents(name)); + assert_eq!(glob.collate(), get_file_contents(name).into_bytes()); glob.remove_all(); } @@ -139,7 +140,7 @@ fn test_split_num_prefixed_chunks_by_lines() { panic!(); } assert_eq!(glob.count(), 10); - assert_eq!(glob.collate(), get_file_contents(name)); + assert_eq!(glob.collate(), get_file_contents(name).into_bytes()); glob.remove_all(); } @@ -152,6 +153,6 @@ fn test_split_str_prefixed_chunks_by_lines() { panic!(); } assert_eq!(glob.count(), 10); - assert_eq!(glob.collate(), get_file_contents(name)); + assert_eq!(glob.collate(), get_file_contents(name).into_bytes()); glob.remove_all(); }