Commit Graph

303 Commits

Author SHA1 Message Date
Louis Gesbert
8c1696d0ff Inline tests: cleanup trailing whitespace 2022-09-23 16:56:21 +02:00
Louis Gesbert
fe6fabb1b0 Clerk tests: update README 2022-09-23 16:41:22 +02:00
Louis Gesbert
0c0ef1ae1a Add test return codes
Simply re-generated with 'make tests CLERK_OPTS=--reset'
2022-09-23 14:50:02 +02:00
Louis Gesbert
0ab7a0f9ce Turn all existing tests to inline tests
Done using
```bash
process() { FILE=$1; awk 'match($0, /^```catala-test *{ *id *= *"(.*)" *}/, a) {print "```catala-test-inline"; f="'"$(dirname $FILE)/output/$(basename $FILE)"'." a[1]; getline; print "$ " $0; while ((getline<f) > 0) print; next} {print}' $FILE >$FILE.new; mv $FILE.new $FILE; }
for f in tests/test_*/*/*.catala_* examples/**/*.catala_*; do process $f; git add $f; done
for d in $(find -name output -type d); do git rm -r $d; done
```
2022-09-23 14:45:10 +02:00
Louis Gesbert
1b97f55c00 Add a few tests on typing errors
the `err6` test also highlights that Typecheck errors get overly delayed
2022-09-15 17:28:05 +02:00
Aymeric Fromherz
2c5b3dd25e Add unit tests for extension of Z3 backend to non-bool EMatch nodes 2022-09-13 16:05:33 +02:00
Denis Merigoux
d7e219b0dd
Correct test output for proof mode 2022-09-06 14:10:32 +02:00
Denis Merigoux
a1e6d992a9
Fix test output 2022-09-05 10:48:05 +02:00
Raphaël Monat
d9cc2dbb43 Fix format in excepted test 2022-09-05 09:31:39 +02:00
Raphaël Monat
f60cfcc435 Merge branch 'master' of github.com:CatalaLang/catala into dates_calc_lib 2022-08-30 15:14:51 +02:00
Denis Merigoux
5bddde1c68
Fix documentation and test invocation 2022-08-30 13:48:20 +02:00
Louis Gesbert
01cc957b3b Used shared_ast for scopelang expressions 2022-08-26 11:31:14 +02:00
Louis Gesbert
576e0fb3ff Factorise AST printers
Note that there were significant differences between the two printers (see the test diff!). Overall the `dcalc` one seemed newer so that's what I took, with only the required additions from `lcalc` (exceptions, raise and catch)
2022-08-22 19:28:27 +02:00
Denis Merigoux
755b1212a2
Remove division durations 2022-08-19 15:21:29 +02:00
Denis Merigoux
9008a7f0e6
Improving French housing benefits (#314)
Follow-up of #287, #266 and #165.
Time spent
Pair programming sessions

Before 2022-07-11: 50h (50 h for each person of the pair programming duo)

Refactoring sessions

Before 2022-07-11: 24 h
2022-07-14: 3 h

Legal research sessions

Before 2022-07-11: 21,5 h

Testing and debugging

Before 2022-07-11: 13,5 h
2022-07-11: 3 h with Denis
2022-07-13: 2 h with Denis
2022-07-14: 1 h with Denis
2022-07-16: 2 h with Denis
2022-07-19: 2 h with Denis
2022-07-21: 2 h with Denis
2022-08-11: 6 h with Denis
2022-08-15: 4 h with Denis
2022-08-16: 2 h with Denis

UI and form

2022-08-09: 8 h with Denis
2022-08-10: 8 h with Denis
2022-08-15: 2 h with Denis
2022-08-16: 2 h with Denis
2022-08-17: 6 h with Denis
2022-08-18: 4 h with Denis
2022-08-19 14:57:48 +02:00
Louis Gesbert
d9c1426c66 Add test for precedence of local variabes vs. local scopes
Ref. #317
2022-08-19 11:08:28 +02:00
Denis Merigoux
437be673ce
Merge branch 'master' into aides_logement 2022-08-16 14:25:06 +02:00
Denis Merigoux
2ae0efa5dd
Fix subtle bug with the default false value for conditions 2022-08-15 16:47:36 +02:00
Denis Merigoux
1aeb47effd
Fix uncaught type error 2022-08-15 16:20:31 +02:00
Louis Gesbert
0b0e774d1c More factorisation, in particular for variables 2022-08-12 17:18:06 +02:00
Louis Gesbert
f35f18b295 Add local 'let in' bindings 2022-08-09 12:17:31 +02:00
Louis Gesbert
a569589193 Small improvements to the Python and OCaml pretty-printers 2022-08-04 20:43:39 +02:00
Denis Merigoux
a3cf272c71 Restore test 2022-07-29 18:42:14 +02:00
Denis Merigoux
974c2b8d58 Fix bug in Python backend 2022-07-28 15:02:43 +02:00
Louis Gesbert
6d41818e0a Change syntax for set membership predicate
Before: `ELEMENT in SET`; now: `SET contains ELEMENT`

Using the `in` keyword was causing conflicts and blocking #203.
Current proposal has `contient` for the French syntax, and is untranslated (`contains`) for Polish.
2022-07-27 14:34:58 +02:00
Emile Rolley
d9045499c0 refactor(french_law/ocaml): refactor the api_web.ml 2022-07-22 17:01:33 +02:00
Denis Merigoux
b7c468bd1e
Fix faulty unboxing 2022-07-22 16:18:55 +02:00
Denis Merigoux
85144c35fb Simplify default tree encoding 2022-07-22 12:31:02 +02:00
Denis Merigoux
3895743f20 Cleaned code for generating exception graph, now correct and fully general
Missing some encoding optimizations
2022-07-22 12:25:41 +02:00
Denis Merigoux
109c7dec31 Create failing test 2022-07-22 12:11:34 +02:00
Denis Merigoux
6d224e1a41
Merge pull request #272 from AltGr/types-everywhere
Annotate the ASTs with type information everywhere
2022-07-20 11:07:17 +02:00
Emile Rolley
4991350b58 feat(backend/ocaml): disambiguate OCaml record names derived from Catala struct 2022-07-12 16:12:18 +02:00
Louis Gesbert
4726d00df8 Adjust test results
Nothing shocking here:
- division by zero now reported on the application rather than the
operator
- renumbering of printed bindlib variables
- some whitespace changes
2022-07-11 17:43:59 +02:00
Louis Gesbert
d2a182043b Update doc for handling tests 2022-07-11 16:03:47 +02:00
Louis Gesbert
2e5050481d Register all existing tests through the new engine
I removed the '.out' extension for now to preserve the test output file names and avoid a million file renames.

This makes the patch easier to read, and we can do the rename easily in another patch afterwards, without mixing with semantic changes.

(beautiful script àlarrache:
```bash
for f in */*/output/*; do
  target_base=${f##*/}
  target_base=${target_base%%.*}
  echo $f | awk -F. '{
    f=$1"."$2; if ($4 == "") { mode=$3; id=$3 } else { scope="-s "$3; mode=$4; id=$3"."$4}
    printf "\n```catala-test {id=\"%s\"}\ncatala %s %s\n```\n",id,mode,scope;
  }' >> $(dirname $f)/../${target_base}.*; done
```
2022-07-08 17:06:20 +02:00
Denis Merigoux
a78f649377
Add negative test 2022-07-08 14:16:02 +02:00
Denis Merigoux
bdbf202a8d
Minimal implementation of https://github.com/CatalaLang/catala/issues/192#issuecomment-1178750411 2022-07-08 14:10:25 +02:00
Denis Merigoux
8782168632
Added test for month multiplication 2022-06-01 15:20:32 +02:00
kescher
db9eec3b9f add support for duration multiplication
Signed-off-by: Jonathan Protzenko <protz@microsoft.com>
2022-05-31 11:17:38 -07:00
Denis Merigoux
853d92ad34
Fix test encoding 2022-05-31 16:24:37 +02:00
Louis Gesbert
9ef8625df7 Compiler: support cumulative exceptions
Closes #208 (implementing Solution 1, without adding an explicit syntax)

Two exceptions or more, e.g. `(j1 |- c1)` and `(j2 |- c2)` such that `c1
= c2`, are collapsed by this transformation into `((j1 |- c1) | j2 |-
c2)`, introducing an arbitrary precedence that avoids the conflict.

The transormation is not applied if any exceptions apply to the subterms
themselves: while these exceptions could be merged, that would turn more
conflicts into arbitrary outcomes than wanted.
2022-05-30 14:22:34 +02:00
Louis Gesbert
cd70e16ea3 Compiler: simplify EDefault term at construction
This allows to match on their structure further on.
2022-05-25 18:36:07 +02:00
Louis Gesbert
05e3205fc9 Parser: priority tweaks
- makes sums and mults left-associative instead of right-associative (see the
  change in the tests!)
- uses higher priority for unary operators
2022-05-11 19:26:34 +02:00
Denis Merigoux
09e7ba762d
Rename test 2022-05-05 17:34:48 +02:00
Denis Merigoux
080e60c25d
Fixes money cents parsing 2022-05-05 16:50:33 +02:00
Denis Merigoux
c7b84ca2d0
Merge pull request #244 from CatalaLang/c_backend
Bringing structure to the Lcalc AST
2022-05-05 14:22:26 +02:00
Denis Merigoux
78e8275d5e
Adds a decimal rounding operator 2022-04-29 21:18:15 +02:00
Denis Merigoux
1c86c8298b
Fix decimal parsing 2022-04-22 14:26:28 +02:00
Denis Merigoux
171c3966f5
Pass some make flags to Clerk 2022-04-14 11:47:18 +02:00
Romain PRIMET
eafab30809 fix typo 2022-04-07 22:43:05 +02:00