catala/tests/test_struct/bad/nested2.catala_en
Louis Gesbert 5efa61a0ce Clerk: rewrite 'clerk runtest' to use the new lightweight lexer
* Obsolete code for included tests has been removed

* The engine uses a proper lexer and is much simplified

* An inline test in the middle of the file now only "sees" the file up to that
  point. This fixes an issue where we had spurious errors when a type error was
  added at the end of a file, and it would pop up in tests before it. This makes
  files including many tests much more practical.

* diffing and resetting the tests has been reintroduced (done at the moment in
  Ninja, but for more control (count number of failed tests, etc.) we could put it
  back into Clerk at some point

* The Catala CLI can now take an input from stdin (with the possibility to link
  a (possibly fake) on-disk file for error reporting and file locations ; this
  is useful for running tests)
2023-09-27 13:18:18 +02:00

71 lines
1.7 KiB
Plaintext

## Article
```catala
declaration structure S:
data x content E
data y content integer
declaration enumeration E:
-- Case1 content boolean
-- Case2 content S
declaration scope A:
output x content E
```
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "x" is declared but never defined; did you forget something?
┌─⯈ tests/test_struct/bad/nested2.catala_en:13.10-13.11:
└──┐
13 │ output x content E
│ ‾
└─ Article
[WARNING] The structure "S" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested2.catala_en:4.23-4.24:
└─┐
4 │ declaration structure S:
│ ‾
└─ Article
[WARNING] The enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_struct/bad/nested2.catala_en:8.25-8.26:
└─┐
8 │ declaration enumeration E:
│ ‾
└─ Article
[ERROR]
Cyclic dependency detected between types!
Cycle type S, declared:
┌─⯈ tests/test_struct/bad/nested2.catala_en:4.23-4.24:
└─┐
4 │ declaration structure S:
│ ‾
└─ Article
Used here in the definition of another cycle type E:
┌─⯈ tests/test_struct/bad/nested2.catala_en:10.20-10.21:
└──┐
10 │ -- Case2 content S
│ ‾
└─ Article
Cycle type E, declared:
┌─⯈ tests/test_struct/bad/nested2.catala_en:8.25-8.26:
└─┐
8 │ declaration enumeration E:
│ ‾
└─ Article
Used here in the definition of another cycle type S:
┌─⯈ tests/test_struct/bad/nested2.catala_en:5.18-5.19:
└─┐
5 │ data x content E
│ ‾
└─ Article
#return code 123#
```