diff --git a/tests/stylesheets/case.bass b/tests/stylesheets/case.bass index 973cda1..f27f4be 100644 --- a/tests/stylesheets/case.bass +++ b/tests/stylesheets/case.bass @@ -1,4 +1,4 @@ -$colors = [yellow, blue, pink] +var colors = [yellow, blue, pink] for $color in $colors: case $color diff --git a/tests/stylesheets/for.bass b/tests/stylesheets/for.bass index f59e622..2c1dc5d 100644 --- a/tests/stylesheets/for.bass +++ b/tests/stylesheets/for.bass @@ -1,4 +1,4 @@ -$colors = [blue, yellow, pink, green] +var colors = [blue, yellow, pink, green] for $color in $colors: .btn-{$color} diff --git a/tests/stylesheets/forjson.bass b/tests/stylesheets/forjson.bass index 480949a..8e91b4a 100644 --- a/tests/stylesheets/forjson.bass +++ b/tests/stylesheets/forjson.bass @@ -1,4 +1,4 @@ -$config = @json "sample.json" +const config = @json "sample.json" for $color in $config["colors"]: .btn-{$color} diff --git a/tests/stylesheets/unused.bass b/tests/stylesheets/unused.bass index 5959ee6..1558d65 100644 --- a/tests/stylesheets/unused.bass +++ b/tests/stylesheets/unused.bass @@ -1 +1 @@ -$config = @json "sample.json" \ No newline at end of file +const config = @json "sample.json" \ No newline at end of file diff --git a/tests/stylesheets/vars.bass b/tests/stylesheets/vars.bass index 4fa78f0..80f6428 100644 --- a/tests/stylesheets/vars.bass +++ b/tests/stylesheets/vars.bass @@ -1,12 +1,11 @@ -$a = 5px -$b = 10px -$c = true -$d = 10 -$e = 1.0 +var a = 5px +var b = 10px +var c = true +var d = 10 +var e = 1.0 -echo $a > $b -echo $a == 5px -echo $b == 10px - -$MAX_WIDTH = 1240px // immutable -echo $MAX_WIDTH \ No newline at end of file +assert $a == 5px +assert "abc" == "abc" +assert 1 == 1 +assert true == true +assert 10 + 10 == 21 \ No newline at end of file diff --git a/tests/test1.nim b/tests/test1.nim index fc693e4..a8b9ce2 100644 --- a/tests/test1.nim +++ b/tests/test1.nim @@ -6,12 +6,6 @@ proc getPath(append: string): string = var paths = ["basic", "invalid", "for", "forjson", "case", "unused", "vars"] -test "var declarations": - var p = parseStylesheet(paths[6].getPath) - check p.hasErrors == false - var c = newCompiler(p.getStylesheet) - echo c.getCSS - test "can parse": var p = parseStylesheet(paths[0].getPath()) check p.hasErrors == false @@ -42,21 +36,29 @@ test "can catch warnings": check p.hasErrors == false check p.hasWarnings == true -test "can compile `for` blocks": +test "var declarations": + var p = parseStylesheet(paths[6].getPath) + check p.hasErrors == false + var c = newCompiler(p.getStylesheet) + echo c.getCSS + +test "`for` blocks": let path = paths[2].getPath() var p = parseStylesheet(path) check p.hasErrors == false check p.hasWarnings == false let c = newCompiler(p.getStylesheet) + echo c.getCSS -test "can compile `for` blocks w/ @json": +test "`for` blocks w/ @json": let path = paths[3].getPath() var p = parseStylesheet(path) check p.hasErrors == false check p.hasWarnings == false let c = newCompiler(p.getStylesheet) + echo c.getCSS -test "can compile `case` blocks": +test "`case` blocks": let path = paths[4].getPath() var p = parseStylesheet(path) check p.hasErrors == false