2021-08-06 06:36:58 -04:00
|
|
|
use crate::minify::attr::{
|
|
|
|
encode_unquoted, encode_using_double_quotes, encode_using_single_quotes,
|
|
|
|
};
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_encode_using_double_quotes() {
|
2021-08-06 07:04:47 -04:00
|
|
|
let min = encode_using_double_quotes(br#"abr"aca"dab && ""10";""8"$4 a""#);
|
2021-08-06 06:36:58 -04:00
|
|
|
assert_eq!(
|
|
|
|
min.str(),
|
2021-08-06 07:04:47 -04:00
|
|
|
r#""abr"aca"dab && ""10";""8"$4 a"""#,
|
2021-08-06 06:36:58 -04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_encode_using_single_quotes() {
|
2021-08-06 09:07:55 -04:00
|
|
|
let min = encode_using_single_quotes(br#"'abr'aca'dab &&''10';''8'$4 a'"#);
|
2021-08-06 06:36:58 -04:00
|
|
|
assert_eq!(
|
|
|
|
min.str(),
|
2021-08-06 07:04:47 -04:00
|
|
|
r#"''abr'aca'dab &&''10';''8'$4 a''"#,
|
2021-08-06 06:36:58 -04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_encode_unquoted() {
|
2021-08-07 11:45:25 -04:00
|
|
|
let min = encode_unquoted(br#""123' 'h 0 && ;abbibi "' \ >& 3>;"#, false);
|
2021-08-06 06:36:58 -04:00
|
|
|
assert_eq!(
|
|
|
|
min.str(),
|
2021-08-06 07:04:47 -04:00
|
|
|
r#""123' 'h   0 && ;abbibi "' \ >& 3>;"#,
|
2021-08-06 06:36:58 -04:00
|
|
|
);
|
|
|
|
}
|