mirror of
https://github.com/flextype/flextype.git
synced 2025-08-08 06:06:45 +02:00
feat(expressions): add new round
and abs
expressions
This commit is contained in:
@@ -30,4 +30,14 @@ test('min expression', function () {
|
||||
test('max expression', function () {
|
||||
entries()->create('max', ['test' => '[[ max(2, 3, 1, 6, 7) ]]']);
|
||||
expect(entries()->fetch('max')['test'])->toBe('7');
|
||||
});
|
||||
|
||||
test('abs expression', function () {
|
||||
entries()->create('abs', ['test' => '[[ abs(-4.2) ]]']);
|
||||
expect(entries()->fetch('abs')['test'])->toBe('4.2');
|
||||
});
|
||||
|
||||
test('round expression', function () {
|
||||
entries()->create('round', ['test' => '[[ round(3.4) ]]']);
|
||||
expect(entries()->fetch('round')['test'])->toBe('3');
|
||||
});
|
Reference in New Issue
Block a user