catala/tests/test_variable_state/bad/state_cycle.catala_en
Aminata-Dev b087ca4f47 Improve suggestions
- Improved implementation of suggestions (suggestion_minimum_levenshtein_distance_association > suggestions.ml)
- Magnifying glass emoji added for suggestions
- Improve display by...
	- Fixing "Pos.ml" (pretty-printing box not closed)
	- Remove unnecessary spaces
- compiler/surface/parserdriver.ml
	- Optionnal suggestions added when raising a parser error
	- Function "levenshtein_distance" removed and replaced by "Suggestions.levenshtein_distance"
- Tests updated (mostly line breaks and spacing changes)
- Variable names renamed for greater clarity
- (Based on commit 0813f5c36e)
2023-07-12 11:55:11 +02:00

57 lines
1.6 KiB
Plaintext

## Test
```catala
declaration scope A:
output foo content integer
state bar
state baz
output foofoo content integer
state bar
state baz
scope A:
definition foo state bar equals foofoo
definition foo state baz equals foo + 1
definition foofoo state bar equals foo
definition foofoo state baz equals foofoo + 1
```
```catala-test-inline
$ catala Typecheck
[ERROR]
Cyclic dependency detected between the following variables of scope A:
foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar
foofoo@bar is used here in the definition of foofoo@baz:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:19.38-19.44:
└──┐
19 │ definition foofoo state baz equals foofoo + 1
│ ‾‾‾‾‾‾
└─ Test
foofoo@baz is used here in the definition of foo@bar:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:13.35-13.41:
└──┐
13 │ definition foo state bar equals foofoo
│ ‾‾‾‾‾‾
└─ Test
foo@bar is used here in the definition of foo@baz:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:15.35-15.38:
└──┐
15 │ definition foo state baz equals foo + 1
│ ‾‾‾
└─ Test
foo@baz is used here in the definition of foofoo@bar:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:17.38-17.41:
└──┐
17 │ definition foofoo state bar equals foo
│ ‾‾‾
└─ Test
#return code 123#
```