Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added while loop tests

  • Loading branch information...
commit 27fcfe7625a944ed0928597dfd93a4211ab7eeb8 1 parent 3017079
@mekto authored
Showing with 98 additions and 0 deletions.
  1. +38 −0 test/cases/while.css
  2. +60 −0 test/cases/while.styl
View
38 test/cases/while.css
@@ -0,0 +1,38 @@
+body {
+ foo: 20 10 5 2.5;
+}
+body {
+ foo: 16;
+}
+body {
+ foo: 23;
+}
+body {
+ found-at: 6;
+}
+body {
+ foo: abc;
+ foo: xyz;
+ foo: klm;
+}
+body > div {
+ foo: -2;
+}
+body > div {
+ foo: -1;
+}
+body > div {
+ foo: 0;
+}
+body > div {
+ foo: 1;
+}
+body > div {
+ foo: 2;
+}
+body {
+ foo: 3;
+ foo: 9;
+ foo: 27;
+ foo: 81;
+}
View
60 test/cases/while.styl
@@ -0,0 +1,60 @@
+test()
+ n = 20
+ ret = ()
+ while n > 2
+ push(ret, n)
+ n = n / 2
+ ret
+
+body
+ foo test()
+
+n = 10
+while n < 15
+ n += 2
+
+body
+ foo n
+
+loop = true
+while loop
+ n += 1
+ if n > 22
+ loop = false
+
+body
+ foo n
+
+search(needle, items)
+ found = false
+ i = 0
+ while not found and i < length(items)
+ if needle == items[i]
+ found = true
+ else
+ i += 1
+ found ? i : -1
+
+body
+ found-at search(4, 1 3 7 23 55 2 4 99 101)
+
+test2()
+ n = 0
+ while n < length(arguments)
+ foo arguments[n]
+ n += 1
+
+body
+ test2 (abc xyz klm)
+
+n = -2
+while n <= 2
+ body
+ & > div
+ foo n
+ n += 1
+
+body
+ i = 1
+ while i <= 27
+ foo (i *= 3)
Please sign in to comment.
Something went wrong with that request. Please try again.