From eb690b9adfa8fa6cd1a787d23d8f78b8a02b4160 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 25 Apr 2020 12:10:50 -0400 Subject: [PATCH] test for superselector in function called from get-function --- src/value/sass_function.rs | 1 - tests/get-function.rs | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/value/sass_function.rs b/src/value/sass_function.rs index f7cd14a..82d265f 100644 --- a/src/value/sass_function.rs +++ b/src/value/sass_function.rs @@ -59,7 +59,6 @@ impl SassFunction { ) -> SassResult { match self { Self::Builtin(f, ..) => f.0(args, scope, super_selector), - // todo: superselector Self::UserDefined(f, ..) => f.eval(args, scope, super_selector), } } diff --git a/tests/get-function.rs b/tests/get-function.rs index f39f98f..bfd047d 100644 --- a/tests/get-function.rs +++ b/tests/get-function.rs @@ -79,12 +79,12 @@ test!( "a {b: call(get-function(lighten), $color: red, $amount: 5);}", "a {\n b: #ff1a1a;\n}\n" ); -// test!( -// call_user_defined_super_selector, -// "@function user-defined() {\n @return &;\n}\n -// a {b: call(get-function(user-defined));}", -// "a {\n b: a;\n}\n" -// ); +test!( + call_user_defined_super_selector, + "@function user-defined() {\n @return &;\n}\n + a {b: call(get-function(user-defined));}", + "a {\n b: a;\n}\n" +); error!( undefined_function, "a {color: get-function(foo);}", "Error: Function not found: foo"