diff --git a/tests/imports.rs b/tests/imports.rs index 6ab0b0e..a05ee9f 100644 --- a/tests/imports.rs +++ b/tests/imports.rs @@ -105,6 +105,38 @@ fn comma_separated_import_order() { ); } +#[test] +fn comma_separated_import_order_css() { + let input = + "@import 'comma_separated_import_order1.css', 'comma_separated_import_order2', url(third);"; + tempfile!("comma_separated_import_order1.css", "p { color: red; }"); + tempfile!("comma_separated_import_order2", "p { color: blue; }"); + assert_eq!( + "@import \"comma_separated_import_order1.css\";\n\np {\n color: blue;\n}\n@import url(third);\n", + &grass::from_string(input.to_string(), &grass::Options::default()).expect(input) + ); +} + +#[test] +fn comma_separated_import_trailing() { + let input = + "@import 'comma_separated_import_trailing1', 'comma_separated_import_trailing2', url(third),,,,,,,,;"; + tempfile!("comma_separated_import_trailing1", "p { color: red; }"); + tempfile!("comma_separated_import_trailing2", "p { color: blue; }"); + + match grass::from_string(input.to_string(), &grass::Options::default()) { + Ok(..) => panic!("did not fail"), + Err(e) => assert_eq!( + "Error: Expected expression.", + e.to_string() + .chars() + .take_while(|c| *c != '\n') + .collect::() + .as_str() + ), + } +} + #[test] fn finds_name_scss() { let input = "@import \"finds_name_scss\";\na {\n color: $a;\n}";