Skip to content

Commit

Permalink
test: verify built-in function overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Feb 7, 2024
1 parent 39b0af5 commit 29f65ec
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/interpreter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,22 @@ describe('interpreter', function() {

});


describe('built-in function overrides', function() {

expr('date', '13-11-1996', { date: '13-11-1996' });

// if you override a variable, bad things can happen
expr('date("2020-07-31")', null, { date: '13-11-1996' });

expr('abs(-1)', 'absolute of -1', {
abs(num) {
return `absolute of ${num}`;
}
});

});

});

});
Expand Down

0 comments on commit 29f65ec

Please sign in to comment.