Skip to content

Commit

Permalink
Fix a bug in dotted property extract in loop works test.
Browse files Browse the repository at this point in the history
The test was broken when it was committed, only becuase the control character in loop was wrong.

Part of #50. Broken in f9f4023
  • Loading branch information
jkomoros committed Jul 23, 2023
1 parent 97e78e4 commit 2b28be8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/template/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,16 +672,17 @@ describe('template.extract', () => {
assert.deepStrictEqual(actual, golden);
});

it('dotted property extract works', () => {
const template = '{{ @loop:bar}}foo{{ a.b|int}}{{%end}}';
it('dotted property extract in loop works', () => {
const template = '{{ @loop:bar}}foo{{ a.b|int}}{{@end}}';
const input = 'foo342';
const t = new Template(template);
const actual = t.extract(input);
const golden = {
bar: [
{
a: {
b: 342
//TODO: this ideally would be 342.
b: 3
}
}
]
Expand Down

0 comments on commit 2b28be8

Please sign in to comment.