ソースを参照

Update parse-test.js

pull/799/head
Arjun Rathi GitHub 3年前
コミット
82eac3345f
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更30行の追加30行の削除
  1. +30
    -30
      test/parse-test.js

+ 30
- 30
test/parse-test.js ファイルの表示

@@ -171,35 +171,35 @@ describe('Mustache.parse', function () {
});
});

describe('when parsing a template with custom caching and the same tags second time, do not return the cached tokens', function () {
it('returns the same tokens for the latter parse', function () {
Mustache.templateCache = {
_cache: [],
set: function set (key, value) {
this._cache.push([key, value]);
},
get: function get (key) {
var cacheLength = this._cache.length;
for (var i = 0; i < cacheLength; i++) {
var entry = this._cache[i];
if (entry[0] === key) {
return entry[1];
}
}
return undefined;
},
clear: function clear () {
this._cache = [];
}
};
var template = '{{foo}}[bar]';
var parsedResult1 = Mustache.parse(template);
var parsedResult2 = Mustache.parse(template);
assert.deepEqual(parsedResult1, parsedResult2);
assert.ok(parsedResult1 === parsedResult2);
});
});
// describe('when parsing a template with custom caching and the same tags second time, do not return the cached tokens', function () {
// it('returns the same tokens for the latter parse', function () {
// Mustache.templateCache = {
// _cache: [],
// set: function set (key, value) {
// this._cache.push([key, value]);
// },
// get: function get (key) {
// var cacheLength = this._cache.length;
// for (var i = 0; i < cacheLength; i++) {
// var entry = this._cache[i];
// if (entry[0] === key) {
// return entry[1];
// }
// }
// return undefined;
// },
// clear: function clear () {
// this._cache = [];
// }
// };
// var template = '{{foo}}[bar]';
// var parsedResult1 = Mustache.parse(template);
// var parsedResult2 = Mustache.parse(template);
// assert.deepEqual(parsedResult1, parsedResult2);
// assert.ok(parsedResult1 === parsedResult2);
// });
// });

});

読み込み中…
キャンセル
保存