Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test indentation

  • Loading branch information...
commit efe487485f44d8b339bd617ac75d377a7a85811b 1 parent 1861b10
@tj tj authored
Showing with 104 additions and 104 deletions.
  1. +104 −104 test/filters.test.js
View
208 test/filters.test.js
@@ -52,108 +52,108 @@ Visitor.prototype.visitTag = function(node){
};
module.exports = {
- 'test :cdata filter': function(assert){
- assert.equal('<![CDATA[\nfoo\n]]>', render(':cdata\n foo'));
- assert.equal('<![CDATA[\nfoo\nbar\n]]>', render(':cdata\n foo\n bar'));
- assert.equal('<![CDATA[\nfoo\nbar\n]]><p>something else</p>', render(':cdata\n foo\n bar\np something else'));
- },
-
- 'test :markdown filter': function(assert){
- assert.equal(
- '<h1>foo</h1>\n\n<ul><li>bar</li><li>baz</li></ul>',
- render(':markdown\n #foo\n - bar\n - baz\n'))
- },
-
- 'test :stylus filter': function(assert){
- assert.equal(
- '<style>body {\n color: #c00;\n}\n</style>',
- render(':stylus\n body\n color #c00'));
- },
-
- 'test :stylus filter with options': function(assert){
- assert.equal(
- '<style>body{color:#c00}\n</style>',
- render(':stylus(compress=true)\n body\n color #c00'));
- },
-
- 'test :less filter': function(assert){
- assert.equal(
- '<style>.class {\n width: 20px;\n}\n</style>',
- render(':less\n .class { width: 10px * 2 }\n'));
- },
-
- 'test :coffeescript filter': function(assert){
- var coffee, js;
- coffee = [
- ':coffeescript',
- ' square = (x) ->',
- ' x * x'
- ].join('\n');
- js = [
- '<script type="text/javascript">',
- '(function() {',
- ' var square;',
- ' square = function(x) {',
- ' return x * x;',
- ' };',
- '}).call(this);',
- '</script>'
- ].join('\n');
-
- assert.equal(js, render(coffee));
-
- coffee = [
- ':coffeescript',
- ' $ ->',
- ' $("#flash").fadeIn ->',
- ' console.log("first line")',
- ' console.log("second line")'
- ].join('\n');
- js = [
- '<script type="text/javascript">',
- '(function() {',
- ' $(function() {',
- ' return $("#flash").fadeIn(function() {',
- ' console.log("first line");',
- ' return console.log("second line");',
- ' });',
- ' });',
- '}).call(this);',
- '</script>'
- ].join('\n');
-
- assert.equal(js, render(coffee));
- },
-
- 'test parse tree': function(assert){
- var str = [
- 'conditionals:',
- ' if false',
- ' | oh noes',
- ' else',
- ' if null == false',
- ' p doh',
- ' else',
- ' p amazing!'
- ].join('\n');
-
- var html = [
- '<p>amazing!</p>'
- ].join('');
-
- assert.equal(html, render(str));
- },
-
- 'test filter attrs': function(assert){
- jade.filters.testing = function(str, attrs){
- return str + ' ' + attrs.stuff;
- };
-
- var str = [
- ':testing(stuff)',
- ' foo bar',
- ].join('\n');
-
- assert.equal('foo bar true', render(str));
- }
+ 'test :cdata filter': function(assert){
+ assert.equal('<![CDATA[\nfoo\n]]>', render(':cdata\n foo'));
+ assert.equal('<![CDATA[\nfoo\nbar\n]]>', render(':cdata\n foo\n bar'));
+ assert.equal('<![CDATA[\nfoo\nbar\n]]><p>something else</p>', render(':cdata\n foo\n bar\np something else'));
+ },
+
+ 'test :markdown filter': function(assert){
+ assert.equal(
+ '<h1>foo</h1>\n\n<ul><li>bar</li><li>baz</li></ul>',
+ render(':markdown\n #foo\n - bar\n - baz\n'))
+ },
+
+ 'test :stylus filter': function(assert){
+ assert.equal(
+ '<style>body {\n color: #c00;\n}\n</style>',
+ render(':stylus\n body\n color #c00'));
+ },
+
+ 'test :stylus filter with options': function(assert){
+ assert.equal(
+ '<style>body{color:#c00}\n</style>',
+ render(':stylus(compress=true)\n body\n color #c00'));
+ },
+
+ 'test :less filter': function(assert){
+ assert.equal(
+ '<style>.class {\n width: 20px;\n}\n</style>',
+ render(':less\n .class { width: 10px * 2 }\n'));
+ },
+
+ 'test :coffeescript filter': function(assert){
+ var coffee, js;
+ coffee = [
+ ':coffeescript',
+ ' square = (x) ->',
+ ' x * x'
+ ].join('\n');
+ js = [
+ '<script type="text/javascript">',
+ '(function() {',
+ ' var square;',
+ ' square = function(x) {',
+ ' return x * x;',
+ ' };',
+ '}).call(this);',
+ '</script>'
+ ].join('\n');
+
+ assert.equal(js, render(coffee));
+
+ coffee = [
+ ':coffeescript',
+ ' $ ->',
+ ' $("#flash").fadeIn ->',
+ ' console.log("first line")',
+ ' console.log("second line")'
+ ].join('\n');
+ js = [
+ '<script type="text/javascript">',
+ '(function() {',
+ ' $(function() {',
+ ' return $("#flash").fadeIn(function() {',
+ ' console.log("first line");',
+ ' return console.log("second line");',
+ ' });',
+ ' });',
+ '}).call(this);',
+ '</script>'
+ ].join('\n');
+
+ assert.equal(js, render(coffee));
+ },
+
+ 'test parse tree': function(assert){
+ var str = [
+ 'conditionals:',
+ ' if false',
+ ' | oh noes',
+ ' else',
+ ' if null == false',
+ ' p doh',
+ ' else',
+ ' p amazing!'
+ ].join('\n');
+
+ var html = [
+ '<p>amazing!</p>'
+ ].join('');
+
+ assert.equal(html, render(str));
+ },
+
+ 'test filter attrs': function(assert){
+ jade.filters.testing = function(str, attrs){
+ return str + ' ' + attrs.stuff;
+ };
+
+ var str = [
+ ':testing(stuff)',
+ ' foo bar',
+ ].join('\n');
+
+ assert.equal('foo bar true', render(str));
+ }
};
Please sign in to comment.
Something went wrong with that request. Please try again.