From 074b6b50ce7e7bd62a6f03955fa5553469d26e1f Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Mon, 6 Apr 2020 00:44:12 -0400 Subject: [PATCH] initial at-root tests --- tests/at-root.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/at-root.rs diff --git a/tests/at-root.rs b/tests/at-root.rs new file mode 100644 index 0000000..be34a08 --- /dev/null +++ b/tests/at-root.rs @@ -0,0 +1,30 @@ +#![cfg(test)] + +#[macro_use] +mod macros; + +test!( + simple_nested, + ".foo {\n @at-root {\n .bar {a: b}\n }\n}\n" + ".bar {\n a: b;\n}\n" +); +test!( + with_selector, + ".foo {\n @at-root .bar {a: b}\n}\n" + ".bar {\n a: b;\n}\n" +); +test!( + with_selector_in_mixin, + "@mixin bar {\n @at-root .bar {a: b}\n}\n\n.foo {\n @include bar;\n}\n" + ".bar {\n a: b;\n}\n" +); +test!( + with_super_selector, + ".foo {\n @at-root & {\n a: b;\n }\n}\n" + ".foo {\n a: b;\n}\n" +); +test!( + nested_with_super_selector, + ".foo {\n @at-root & {\n .bar {\n @at-root & {\n a: b;\n }\n }\n }\n}\n" + ".foo .bar {\n a: b;\n}\n" +);