quote/unquote functions
This commit is contained in:
16
src/lib.rs
16
src/lib.rs
@@ -176,7 +176,7 @@ impl Unquote for String {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{from_base36, ToBase36, optional_data_line, mock, segments_from_string};
|
||||
use crate::{from_base36, ToBase36, optional_data_line, mock, segments_from_string, Quote, Unquote};
|
||||
|
||||
#[test]
|
||||
fn test_from_base36() {
|
||||
@@ -211,4 +211,18 @@ mod test {
|
||||
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_quote() {
|
||||
let output = "this is a string.\nIt has 2 lines".to_string().quote();
|
||||
let expected = "\"\"\"\nthis is a string.\nIt has 2 lines\n\"\"\"".to_string();
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unquote() {
|
||||
let output = "\"\"\"\nwho the fuck is scraeming \"LOG OFF\" at my house.\nshow yourself, coward.\ni will never log off\n\"\"\"".to_string().unquote();
|
||||
let expected = "who the fuck is scraeming \"LOG OFF\" at my house.\nshow yourself, coward.\ni will never log off".to_string();
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user