mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
Support create variables on the filter line.
This commit is contained in:
@@ -327,4 +327,9 @@ describe('filters', function() {
|
||||
it('should encode <space>',
|
||||
() => test('{{ "Tetsuro Takara" | url_encode }}', 'Tetsuro%20Takara'));
|
||||
});
|
||||
|
||||
describe('obj_test', function() {
|
||||
liquid.registerFilter('obj_test', (...v) => v.join(','));
|
||||
it('should support object', () => test('{{ "a" | obj_test: k1: "v1", k2: "v2" }}', 'a,k1,v1,k2,v2'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,9 @@ describe('lexical', function() {
|
||||
lexical.filterLine.test('foo: a, "b"').should.equal(true);
|
||||
lexical.filterLine.test('abs | another').should.equal(false);
|
||||
lexical.filterLine.test('join: "," | another').should.equal(false);
|
||||
lexical.filterLine.test('obj_test: k1: "v1", k2: "v2"').should.equal(true);
|
||||
});
|
||||
|
||||
it('should test boolean literal', function() {
|
||||
lexical.isLiteral('true').should.equal(true);
|
||||
lexical.isLiteral('TrUE').should.equal(true);
|
||||
|
||||
Reference in New Issue
Block a user