mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 06:50:47 -07:00
Add test for property access syntax
This commit is contained in:
committed by
Jun Yang
parent
0408ae7f53
commit
af841dc872
@@ -96,6 +96,18 @@ describe('Value', function () {
|
||||
it('should tokenize a filter with a single argument', function () {
|
||||
expect(Value.tokenize('foo | add: 1')).to.eql(['foo', '|', 'add', ':', '1'])
|
||||
})
|
||||
it('should tokenize array indexing', function () {
|
||||
expect(Value.tokenize('arr[0]')).to.eql(['arr[0]'])
|
||||
})
|
||||
it('should tokenize simple object access', function () {
|
||||
expect(Value.tokenize('obj["foo"]')).to.eql(['obj["foo"]'])
|
||||
})
|
||||
it('should tokenize simple dot syntax object access', function () {
|
||||
expect(Value.tokenize('obj.foo')).to.eql(['obj.foo'])
|
||||
})
|
||||
it('should tokenize complex object property access', function () {
|
||||
expect(Value.tokenize('obj["complex:string here"]')).to.eql(['obj["complex:string here"]'])
|
||||
})
|
||||
})
|
||||
|
||||
describe('#value()', function () {
|
||||
|
||||
Reference in New Issue
Block a user