mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 08:47:14 +03:00
0ab7a0f9ce
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 ```
42 lines
580 B
Plaintext
42 lines
580 B
Plaintext
# Test the refactored metatdata markup
|
|
|
|
```catala-metadata
|
|
declaration enumeration E:
|
|
-- A
|
|
-- B
|
|
|
|
declaration scope S:
|
|
context output a content E
|
|
```
|
|
|
|
Some law text...
|
|
|
|
```catala-metadata
|
|
declaration scope S2:
|
|
context output b content E
|
|
```
|
|
|
|
## PROGRAM
|
|
|
|
```catala
|
|
scope S:
|
|
definition a equals A
|
|
```
|
|
|
|
```catala
|
|
scope S2:
|
|
definition b equals B
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Interpret -s S2
|
|
[RESULT] Computation successful! Results:
|
|
[RESULT] b = B ()
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Interpret -s S
|
|
[RESULT] Computation successful! Results:
|
|
[RESULT] a = A ()
|
|
```
|