Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed tests

  • Loading branch information...
commit 41a2cc014861f729e9a5990906edc75f2d81ead6 1 parent 7093c24
@eprev authored
View
2  Gruntfile.js
@@ -83,7 +83,7 @@ module.exports = function (grunt) {
name: 'foo'
}
},
- named_function_withing_dynamic_expansion: {
+ named_function_within_dynamic_expansion: {
files: [{
expand: true, // Enable dynamic expantion.
src: ['test/fixtures/qux/**/*.xml'],
View
149 test/expected/fixtures/qux/bar/baz.js
@@ -0,0 +1,149 @@
+function(__fest_context) {
+ "use strict";
+ var __fest_self = this,
+ __fest_buf = "",
+ __fest_chunks = [],
+ __fest_chunk, __fest_attrs = [],
+ __fest_select, __fest_if, __fest_iterator, __fest_to, __fest_fn, __fest_html = "",
+ __fest_blocks = {},
+ __fest_params, __fest_element, __fest_debug_file = "",
+ __fest_debug_line = "",
+ __fest_debug_block = "",
+ __fest_htmlchars = /[&<>"]/g,
+ __fest_short_tags = {
+ "area": true,
+ "base": true,
+ "br": true,
+ "col": true,
+ "command": true,
+ "embed": true,
+ "hr": true,
+ "img": true,
+ "input": true,
+ "keygen": true,
+ "link": true,
+ "meta": true,
+ "param": true,
+ "source": true,
+ "wbr": true
+ },
+ __fest_element_stack = [],
+ __fest_htmlhash = {
+ "&": "&amp;",
+ "<": "&lt;",
+ ">": "&gt;",
+ "\"": "&quot;"
+ },
+ __fest_jschars = /[\\'"\/\n\r\t\b\f<>]/g,
+ __fest_jshash = {
+ "\"": "\\\"",
+ "\\": "\\\\",
+ "/": "\\/",
+ "\n": "\\n",
+ "\r": "\\r",
+ "\t": "\\t",
+ "\b": "\\b",
+ "\f": "\\f",
+ "'": "\\'",
+ "<": "\\u003C",
+ ">": "\\u003E"
+ },
+ ___fest_log_error;
+ if (typeof __fest_error === "undefined") {
+ ___fest_log_error = (typeof console !== "undefined" && console.error) ?
+ function() {
+ return Function.prototype.apply.call(console.error, console, arguments)
+ } : function() {};
+ } else {
+ ___fest_log_error = __fest_error
+ };
+
+ function __fest_log_error(msg) {
+ ___fest_log_error(msg + "\nin block \"" + __fest_debug_block + "\" at line: " + __fest_debug_line + "\nfile: " + __fest_debug_file)
+ }
+ function __fest_replaceHTML(chr) {
+ return __fest_htmlhash[chr]
+ }
+ function __fest_replaceJS(chr) {
+ return __fest_jshash[chr]
+ }
+ function __fest_extend(dest, src) {
+ for (var i in src) if (src.hasOwnProperty(i)) dest[i] = src[i];
+ }
+ function __fest_param(fn) {
+ fn.param = true;
+ return fn
+ }
+ function __fest_call(fn, params, cp) {
+ if (cp) for (var i in params) if (typeof params[i] == "function" && params[i].param) params[i] = params[i]();
+ return fn.call(__fest_self, params)
+ }
+ function __fest_escapeJS(s) {
+ if (typeof s === "string") {
+ if (__fest_jschars.test(s)) return s.replace(__fest_jschars, __fest_replaceJS);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ function __fest_escapeHTML(s) {
+ if (typeof s === "string") {
+ if (__fest_htmlchars.test(s)) return s.replace(__fest_htmlchars, __fest_replaceHTML);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "0";
+ __fest_debug_block = "fest:template";
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "1";
+ __fest_debug_block = "fest:get";
+ __fest_select = "block";
+ __fest_params = {};
+ try {
+ __fest_params = Grunt
+ } catch (e) {
+ __fest_log_error(e.message)
+ }
+ __fest_chunks.push(__fest_buf, {
+ name: __fest_select,
+ params: __fest_params,
+ cp: false
+ });
+ __fest_buf = "";
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "2";
+ __fest_debug_block = "fest:set";
+ __fest_blocks.block = function(params) {
+ var __fest_buf = "";
+ __fest_buf += ("Hello,");
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "3";
+ __fest_debug_block = "fest:space";
+ __fest_buf += (" ");
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "3";
+ __fest_debug_block = "fest:value";
+ try {
+ __fest_buf += (__fest_escapeHTML(params))
+ } catch (e) {
+ __fest_log_error(e.message + "3");
+ }
+ __fest_buf += ("!");
+ return __fest_buf;
+ };
+ __fest_to = __fest_chunks.length;
+ if (__fest_to) {
+ __fest_iterator = 0;
+ for (; __fest_iterator < __fest_to; __fest_iterator++) {
+ __fest_chunk = __fest_chunks[__fest_iterator];
+ if (typeof __fest_chunk === "string") {
+ __fest_html += __fest_chunk;
+ } else {
+ __fest_fn = __fest_blocks[__fest_chunk.name];
+ if (__fest_fn) __fest_html += __fest_call(__fest_fn, __fest_chunk.params, __fest_chunk.cp);
+ }
+ }
+ return __fest_html + __fest_buf;
+ } else {
+ return __fest_buf;
+ }
+}
View
149 test/expected/fixtures/qux/bar/baz.xml.js
@@ -0,0 +1,149 @@
+function(__fest_context) {
+ "use strict";
+ var __fest_self = this,
+ __fest_buf = "",
+ __fest_chunks = [],
+ __fest_chunk, __fest_attrs = [],
+ __fest_select, __fest_if, __fest_iterator, __fest_to, __fest_fn, __fest_html = "",
+ __fest_blocks = {},
+ __fest_params, __fest_element, __fest_debug_file = "",
+ __fest_debug_line = "",
+ __fest_debug_block = "",
+ __fest_htmlchars = /[&<>"]/g,
+ __fest_short_tags = {
+ "area": true,
+ "base": true,
+ "br": true,
+ "col": true,
+ "command": true,
+ "embed": true,
+ "hr": true,
+ "img": true,
+ "input": true,
+ "keygen": true,
+ "link": true,
+ "meta": true,
+ "param": true,
+ "source": true,
+ "wbr": true
+ },
+ __fest_element_stack = [],
+ __fest_htmlhash = {
+ "&": "&amp;",
+ "<": "&lt;",
+ ">": "&gt;",
+ "\"": "&quot;"
+ },
+ __fest_jschars = /[\\'"\/\n\r\t\b\f<>]/g,
+ __fest_jshash = {
+ "\"": "\\\"",
+ "\\": "\\\\",
+ "/": "\\/",
+ "\n": "\\n",
+ "\r": "\\r",
+ "\t": "\\t",
+ "\b": "\\b",
+ "\f": "\\f",
+ "'": "\\'",
+ "<": "\\u003C",
+ ">": "\\u003E"
+ },
+ ___fest_log_error;
+ if (typeof __fest_error === "undefined") {
+ ___fest_log_error = (typeof console !== "undefined" && console.error) ?
+ function() {
+ return Function.prototype.apply.call(console.error, console, arguments)
+ } : function() {};
+ } else {
+ ___fest_log_error = __fest_error
+ };
+
+ function __fest_log_error(msg) {
+ ___fest_log_error(msg + "\nin block \"" + __fest_debug_block + "\" at line: " + __fest_debug_line + "\nfile: " + __fest_debug_file)
+ }
+ function __fest_replaceHTML(chr) {
+ return __fest_htmlhash[chr]
+ }
+ function __fest_replaceJS(chr) {
+ return __fest_jshash[chr]
+ }
+ function __fest_extend(dest, src) {
+ for (var i in src) if (src.hasOwnProperty(i)) dest[i] = src[i];
+ }
+ function __fest_param(fn) {
+ fn.param = true;
+ return fn
+ }
+ function __fest_call(fn, params, cp) {
+ if (cp) for (var i in params) if (typeof params[i] == "function" && params[i].param) params[i] = params[i]();
+ return fn.call(__fest_self, params)
+ }
+ function __fest_escapeJS(s) {
+ if (typeof s === "string") {
+ if (__fest_jschars.test(s)) return s.replace(__fest_jschars, __fest_replaceJS);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ function __fest_escapeHTML(s) {
+ if (typeof s === "string") {
+ if (__fest_htmlchars.test(s)) return s.replace(__fest_htmlchars, __fest_replaceHTML);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "0";
+ __fest_debug_block = "fest:template";
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "1";
+ __fest_debug_block = "fest:get";
+ __fest_select = "block";
+ __fest_params = {};
+ try {
+ __fest_params = Grunt
+ } catch (e) {
+ __fest_log_error(e.message)
+ }
+ __fest_chunks.push(__fest_buf, {
+ name: __fest_select,
+ params: __fest_params,
+ cp: false
+ });
+ __fest_buf = "";
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "2";
+ __fest_debug_block = "fest:set";
+ __fest_blocks.block = function(params) {
+ var __fest_buf = "";
+ __fest_buf += ("Hello,");
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "3";
+ __fest_debug_block = "fest:space";
+ __fest_buf += (" ");
+ __fest_debug_file = "test\/fixtures\/qux\/bar\/baz.xml";
+ __fest_debug_line = "3";
+ __fest_debug_block = "fest:value";
+ try {
+ __fest_buf += (__fest_escapeHTML(params))
+ } catch (e) {
+ __fest_log_error(e.message + "3");
+ }
+ __fest_buf += ("!");
+ return __fest_buf;
+ };
+ __fest_to = __fest_chunks.length;
+ if (__fest_to) {
+ __fest_iterator = 0;
+ for (; __fest_iterator < __fest_to; __fest_iterator++) {
+ __fest_chunk = __fest_chunks[__fest_iterator];
+ if (typeof __fest_chunk === "string") {
+ __fest_html += __fest_chunk;
+ } else {
+ __fest_fn = __fest_blocks[__fest_chunk.name];
+ if (__fest_fn) __fest_html += __fest_call(__fest_fn, __fest_chunk.params, __fest_chunk.cp);
+ }
+ }
+ return __fest_html + __fest_buf;
+ } else {
+ return __fest_buf;
+ }
+}
View
113 test/expected/fixtures/qux/foo.js
@@ -0,0 +1,113 @@
+function(__fest_context) {
+ "use strict";
+ var __fest_self = this,
+ __fest_buf = "",
+ __fest_chunks = [],
+ __fest_chunk, __fest_attrs = [],
+ __fest_select, __fest_if, __fest_iterator, __fest_to, __fest_fn, __fest_html = "",
+ __fest_blocks = {},
+ __fest_params, __fest_element, __fest_debug_file = "",
+ __fest_debug_line = "",
+ __fest_debug_block = "",
+ __fest_htmlchars = /[&<>"]/g,
+ __fest_short_tags = {
+ "area": true,
+ "base": true,
+ "br": true,
+ "col": true,
+ "command": true,
+ "embed": true,
+ "hr": true,
+ "img": true,
+ "input": true,
+ "keygen": true,
+ "link": true,
+ "meta": true,
+ "param": true,
+ "source": true,
+ "wbr": true
+ },
+ __fest_element_stack = [],
+ __fest_htmlhash = {
+ "&": "&amp;",
+ "<": "&lt;",
+ ">": "&gt;",
+ "\"": "&quot;"
+ },
+ __fest_jschars = /[\\'"\/\n\r\t\b\f<>]/g,
+ __fest_jshash = {
+ "\"": "\\\"",
+ "\\": "\\\\",
+ "/": "\\/",
+ "\n": "\\n",
+ "\r": "\\r",
+ "\t": "\\t",
+ "\b": "\\b",
+ "\f": "\\f",
+ "'": "\\'",
+ "<": "\\u003C",
+ ">": "\\u003E"
+ },
+ ___fest_log_error;
+ if (typeof __fest_error === "undefined") {
+ ___fest_log_error = (typeof console !== "undefined" && console.error) ?
+ function() {
+ return Function.prototype.apply.call(console.error, console, arguments)
+ } : function() {};
+ } else {
+ ___fest_log_error = __fest_error
+ };
+
+ function __fest_log_error(msg) {
+ ___fest_log_error(msg + "\nin block \"" + __fest_debug_block + "\" at line: " + __fest_debug_line + "\nfile: " + __fest_debug_file)
+ }
+ function __fest_replaceHTML(chr) {
+ return __fest_htmlhash[chr]
+ }
+ function __fest_replaceJS(chr) {
+ return __fest_jshash[chr]
+ }
+ function __fest_extend(dest, src) {
+ for (var i in src) if (src.hasOwnProperty(i)) dest[i] = src[i];
+ }
+ function __fest_param(fn) {
+ fn.param = true;
+ return fn
+ }
+ function __fest_call(fn, params, cp) {
+ if (cp) for (var i in params) if (typeof params[i] == "function" && params[i].param) params[i] = params[i]();
+ return fn.call(__fest_self, params)
+ }
+ function __fest_escapeJS(s) {
+ if (typeof s === "string") {
+ if (__fest_jschars.test(s)) return s.replace(__fest_jschars, __fest_replaceJS);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ function __fest_escapeHTML(s) {
+ if (typeof s === "string") {
+ if (__fest_htmlchars.test(s)) return s.replace(__fest_htmlchars, __fest_replaceHTML);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ __fest_debug_file = "test\/fixtures\/qux\/foo.xml";
+ __fest_debug_line = "0";
+ __fest_debug_block = "fest:template";
+ __fest_buf += ("Test");
+ __fest_to = __fest_chunks.length;
+ if (__fest_to) {
+ __fest_iterator = 0;
+ for (; __fest_iterator < __fest_to; __fest_iterator++) {
+ __fest_chunk = __fest_chunks[__fest_iterator];
+ if (typeof __fest_chunk === "string") {
+ __fest_html += __fest_chunk;
+ } else {
+ __fest_fn = __fest_blocks[__fest_chunk.name];
+ if (__fest_fn) __fest_html += __fest_call(__fest_fn, __fest_chunk.params, __fest_chunk.cp);
+ }
+ }
+ return __fest_html + __fest_buf;
+ } else {
+ return __fest_buf;
+ }
+}
View
113 test/expected/fixtures/qux/foo.xml.js
@@ -0,0 +1,113 @@
+function(__fest_context) {
+ "use strict";
+ var __fest_self = this,
+ __fest_buf = "",
+ __fest_chunks = [],
+ __fest_chunk, __fest_attrs = [],
+ __fest_select, __fest_if, __fest_iterator, __fest_to, __fest_fn, __fest_html = "",
+ __fest_blocks = {},
+ __fest_params, __fest_element, __fest_debug_file = "",
+ __fest_debug_line = "",
+ __fest_debug_block = "",
+ __fest_htmlchars = /[&<>"]/g,
+ __fest_short_tags = {
+ "area": true,
+ "base": true,
+ "br": true,
+ "col": true,
+ "command": true,
+ "embed": true,
+ "hr": true,
+ "img": true,
+ "input": true,
+ "keygen": true,
+ "link": true,
+ "meta": true,
+ "param": true,
+ "source": true,
+ "wbr": true
+ },
+ __fest_element_stack = [],
+ __fest_htmlhash = {
+ "&": "&amp;",
+ "<": "&lt;",
+ ">": "&gt;",
+ "\"": "&quot;"
+ },
+ __fest_jschars = /[\\'"\/\n\r\t\b\f<>]/g,
+ __fest_jshash = {
+ "\"": "\\\"",
+ "\\": "\\\\",
+ "/": "\\/",
+ "\n": "\\n",
+ "\r": "\\r",
+ "\t": "\\t",
+ "\b": "\\b",
+ "\f": "\\f",
+ "'": "\\'",
+ "<": "\\u003C",
+ ">": "\\u003E"
+ },
+ ___fest_log_error;
+ if (typeof __fest_error === "undefined") {
+ ___fest_log_error = (typeof console !== "undefined" && console.error) ?
+ function() {
+ return Function.prototype.apply.call(console.error, console, arguments)
+ } : function() {};
+ } else {
+ ___fest_log_error = __fest_error
+ };
+
+ function __fest_log_error(msg) {
+ ___fest_log_error(msg + "\nin block \"" + __fest_debug_block + "\" at line: " + __fest_debug_line + "\nfile: " + __fest_debug_file)
+ }
+ function __fest_replaceHTML(chr) {
+ return __fest_htmlhash[chr]
+ }
+ function __fest_replaceJS(chr) {
+ return __fest_jshash[chr]
+ }
+ function __fest_extend(dest, src) {
+ for (var i in src) if (src.hasOwnProperty(i)) dest[i] = src[i];
+ }
+ function __fest_param(fn) {
+ fn.param = true;
+ return fn
+ }
+ function __fest_call(fn, params, cp) {
+ if (cp) for (var i in params) if (typeof params[i] == "function" && params[i].param) params[i] = params[i]();
+ return fn.call(__fest_self, params)
+ }
+ function __fest_escapeJS(s) {
+ if (typeof s === "string") {
+ if (__fest_jschars.test(s)) return s.replace(__fest_jschars, __fest_replaceJS);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ function __fest_escapeHTML(s) {
+ if (typeof s === "string") {
+ if (__fest_htmlchars.test(s)) return s.replace(__fest_htmlchars, __fest_replaceHTML);
+ } else if (typeof s === "undefined") return "";
+ return s;
+ }
+ __fest_debug_file = "test\/fixtures\/qux\/foo.xml";
+ __fest_debug_line = "0";
+ __fest_debug_block = "fest:template";
+ __fest_buf += ("Test");
+ __fest_to = __fest_chunks.length;
+ if (__fest_to) {
+ __fest_iterator = 0;
+ for (; __fest_iterator < __fest_to; __fest_iterator++) {
+ __fest_chunk = __fest_chunks[__fest_iterator];
+ if (typeof __fest_chunk === "string") {
+ __fest_html += __fest_chunk;
+ } else {
+ __fest_fn = __fest_blocks[__fest_chunk.name];
+ if (__fest_fn) __fest_html += __fest_call(__fest_fn, __fest_chunk.params, __fest_chunk.cp);
+ }
+ }
+ return __fest_html + __fest_buf;
+ } else {
+ return __fest_buf;
+ }
+}
View
4 test/fest_test.js
@@ -29,7 +29,7 @@ exports.bem = {
},
put_in_the_same_derictory: function (test) {
this.templates.forEach(function (tpl) {
- var actual = grunt.file.read('test/fixtures/' + tpl + '.js');
+ var actual = grunt.file.read('test/expected/fixtures/' + tpl + '.js');
var expected = grunt.file.read('test/fixtures/' + tpl + '.js');
test.equal(actual, expected);
});
@@ -37,7 +37,7 @@ exports.bem = {
},
put_in_the_same_derictory_and_append_ext: function (test) {
this.templates.forEach(function (tpl) {
- var actual = grunt.file.read('test/fixtures/' + tpl + '.xml.js');
+ var actual = grunt.file.read('test/expected/fixtures/' + tpl + '.xml.js');
var expected = grunt.file.read('test/fixtures/' + tpl + '.xml.js');
test.equal(actual, expected);
});
Please sign in to comment.
Something went wrong with that request. Please try again.