mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
42 lines
1015 B
Plaintext
42 lines
1015 B
Plaintext
```catala
|
|
|
|
declaration scope CheckAgeIsLessThan:
|
|
input bday content date
|
|
input today content date
|
|
input age content duration
|
|
output r content boolean
|
|
|
|
scope CheckAgeIsLessThan:
|
|
date round decreasing
|
|
definition r equals bday + age <= today
|
|
date round increasing
|
|
|
|
declaration scope Test:
|
|
output r content boolean
|
|
|
|
scope Test:
|
|
definition r equals (output of CheckAgeIsLessThan with
|
|
{ -- bday: |2000-02-29|
|
|
-- today: |2018-03-01|
|
|
-- age: 18 year}).r
|
|
assertion r
|
|
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Interpret -s Test
|
|
[ERROR]
|
|
You cannot set multiple date rounding modes
|
|
|
|
┌─⯈ tests/date/bad/rounding_option_conflict.catala_en:10.14-10.24:
|
|
└──┐
|
|
10 │ date round decreasing
|
|
│ ‾‾‾‾‾‾‾‾‾‾
|
|
|
|
┌─⯈ tests/date/bad/rounding_option_conflict.catala_en:12.14-12.24:
|
|
└──┐
|
|
12 │ date round increasing
|
|
│ ‾‾‾‾‾‾‾‾‾‾
|
|
#return code 123#
|
|
```
|