From bcc9bd03970932cd1f2e83b12a53081977786295 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Wed, 2 Apr 2014 11:39:14 +0700 Subject: [PATCH] Test case for a recursion --- tests/inputs/mixin_recursive.less | 15 +++++++++++++++ tests/outputs/mixin_recursive.css | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/inputs/mixin_recursive.less create mode 100644 tests/outputs/mixin_recursive.css diff --git a/tests/inputs/mixin_recursive.less b/tests/inputs/mixin_recursive.less new file mode 100644 index 00000000..727222ba --- /dev/null +++ b/tests/inputs/mixin_recursive.less @@ -0,0 +1,15 @@ +// This test for mixin recursion (loops). + +.bg(@filename) +{ + background-image: url('@{filename}'); +} + +.generate_nav(@n; @i: 1) when (@i =< @n) { + #but@{i} { + .bg('@{i}.png'); + } + .generate_nav(@n; (@i+1)); +} + +.generate_nav(5); diff --git a/tests/outputs/mixin_recursive.css b/tests/outputs/mixin_recursive.css new file mode 100644 index 00000000..d8c1c382 --- /dev/null +++ b/tests/outputs/mixin_recursive.css @@ -0,0 +1,15 @@ +#but1 { + background-image: url('1.png'); +} +#but2 { + background-image: url('2.png'); +} +#but3 { + background-image: url('3.png'); +} +#but4 { + background-image: url('4.png'); +} +#but5 { + background-image: url('5.png'); +}