tests(lexer): add tests for the literate programming

This commit is contained in:
EmileRolley 2021-05-24 13:08:26 +02:00
parent c1ea39eb1b
commit c317332218
6 changed files with 59 additions and 3 deletions

View File

@ -0,0 +1,2 @@
[RESULT] Computation successful! Results:
[RESULT] literate_parsing_is_ok = true

View File

@ -0,0 +1,2 @@
[RESULT] Computation successful! Results:
[RESULT] literate_parsing_is_ok = true

View File

@ -1,4 +1,4 @@
## Law text should be able to contain '`'.
## Law text should be able to contain grave accent '`'.
This is a block of law text containing `.
This allows to:
@ -16,10 +16,10 @@ let () = print_endline "Hello world!"
**Remark**: for Fenced Code Blocks, ``` must be followed by a space or a new line.
```catala
new scope Test :
new scope A:
param literate_parsing_is_ok content bool
scope Test :
scope A:
def literate_parsing_is_ok := true
```

View File

@ -0,0 +1,26 @@
## Law text should be able to contain grave accent '`'.
This is a block of law text containing `.
This allows to:
* use `Markdown` code block inside `Catala` files,
* _escape_ special characters such as `#` or `>`,
* use Fenced Code Blocks:
```
let () = print_endline "Hello world!"
```
**Remark**: for Fenced Code Blocks, ``` must be followed by a space or a new line.
```catala
declaration scope A:
context literate_parsing_is_ok content boolean
scope A:
definition literate_parsing_is_ok equals true
```
Even after `Catala` code block.

View File

@ -0,0 +1,26 @@
## Law text should be able to contain grave accent '`'.
This is a block of law text containing `.
This allows to:
* use `Markdown` code block inside `Catala` files,
* _escape_ special characters such as `#` or `>`,
* use Fenced Code Blocks:
```
let () = print_endline "Hello world!"
```
**Remark**: for Fenced Code Blocks, ``` must be followed by a space or a new line.
```catala
déclaration champ d'application A:
contexte literate_parsing_is_ok contenu booléen
champ d'application A:
définition literate_parsing_is_ok égal à vrai
```
Even after `Catala` code block.