From b0d2bdf1cea3e24b9342494d9193497790978383 Mon Sep 17 00:00:00 2001 From: xzyfer Date: Sat, 16 Mar 2019 18:47:09 +1100 Subject: [PATCH] Add specs for content-exists in control statements See https://github.com/sass/libsass/issues/2842 --- .../content-exists/{ => basic}/basic.hrx | 0 .../content-exists/{ => basic}/error.hrx | 0 .../content-exists/controls/controls.hrx | 28 +++++++++++++++++++ 3 files changed, 28 insertions(+) rename spec/core_functions/content-exists/{ => basic}/basic.hrx (100%) rename spec/core_functions/content-exists/{ => basic}/error.hrx (100%) create mode 100644 spec/core_functions/content-exists/controls/controls.hrx diff --git a/spec/core_functions/content-exists/basic.hrx b/spec/core_functions/content-exists/basic/basic.hrx similarity index 100% rename from spec/core_functions/content-exists/basic.hrx rename to spec/core_functions/content-exists/basic/basic.hrx diff --git a/spec/core_functions/content-exists/error.hrx b/spec/core_functions/content-exists/basic/error.hrx similarity index 100% rename from spec/core_functions/content-exists/error.hrx rename to spec/core_functions/content-exists/basic/error.hrx diff --git a/spec/core_functions/content-exists/controls/controls.hrx b/spec/core_functions/content-exists/controls/controls.hrx new file mode 100644 index 000000000..d08225f06 --- /dev/null +++ b/spec/core_functions/content-exists/controls/controls.hrx @@ -0,0 +1,28 @@ +<===> input.scss +@mixin test-content-exists() { + @if content-exists() { + @content; + } + @else { + content-exists: false; + } +} + +.should-be-true { + @include test-content-exists() { + content-exists: true; + } +} + +.should-be-false { + @include test-content-exists(); +} + +<===> output.css +.should-be-true { + content-exists: true; +} + +.should-be-false { + content-exists: false; +}