1
0
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:
Awilum
2022-09-13 12:23:23 +03:00
parent f28f0e5a8a
commit e9e6111ccc
2 changed files with 12 additions and 0 deletions

View File

@@ -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');
});