config.toml: remove excluded files for coverage report
data_to_text.rs: change from . as unrecognized character to ' ' demo.rs: improves POC display of headers tests/primitive_formatting.rs: initial tests of bool formatting
This commit is contained in:
@@ -33,7 +33,7 @@ fn data_to_text() {
|
||||
0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74,
|
||||
0x20, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x20,
|
||||
];
|
||||
let expected_data: &str = "0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x20 fghijklmnopqrst \n0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x20 vwxyz{|}~..\n";
|
||||
let expected_data: &str = "0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 0x71 0x72 0x73 0x74 0x20 fghijklmnopqrst \n0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x20 vwxyz{|}~ \n";
|
||||
|
||||
let actual_data = DataToText::data_to_text(data_to_display);
|
||||
assert_eq!(actual_data, expected_data);
|
||||
@@ -64,3 +64,10 @@ fn data_to_text_window_all() {
|
||||
let expected = read_display("quickbrownfox");
|
||||
assert_eq!(formatted, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_window_past_end_of_data() {
|
||||
let bin_data = [0x01, 0x02, 0x03, 0x04, 0x05, 0x06];
|
||||
let formatted = DataToText::data_to_text_window(&bin_data, 10, 10);
|
||||
assert_eq!(formatted, "");
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@ mod data_to_text;
|
||||
mod number_system_conversion;
|
||||
mod test_compression;
|
||||
mod format_with_commas;
|
||||
mod primitive_formatting;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
use trevors_utilities::primitive_formatting;
|
||||
|
||||
#[test]
|
||||
fn test_primitive_bool() {
|
||||
assert_eq!("1".to_string(), primitive_formatting::bool_to_string(true));
|
||||
assert_eq!("0".to_string(), primitive_formatting::bool_to_string(false));
|
||||
}
|
||||
Reference in New Issue
Block a user