-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: replace negative tests with simple_and_negative tests
batch 3, part of #3714
- Loading branch information
1 parent
94f4f7d
commit e3ba566
Showing
20 changed files
with
884 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
--CURDIR--/choice_negative.fz:29:5: error 1: Cyclic field nesting is not permitted | ||
A is | ||
----^ | ||
Cyclic value field nesting would result in infinitely large objects. | ||
Cycle of nesting found during clazz layout: | ||
--CURDIR--/choice_negative.fz:30:7: | ||
x A | i32 | String := "Hello" // 4. should flag an error: cyclic choice | ||
------^ | ||
|
||
To solve this, you could change one or several of the fields involved to a reference type by adding 'ref' before the type. | ||
|
||
|
||
--CURDIR--/choice_negative.fz:52:5: error 2: Cyclic field nesting is not permitted | ||
A is | ||
----^ | ||
Cyclic value field nesting would result in infinitely large objects. | ||
Cycle of nesting found during clazz layout: | ||
--CURDIR--/choice_negative.fz:53:7: | ||
x i32 | A | String := "Hello" // 5. should flag an error: cyclic choice | ||
------^ | ||
|
||
To solve this, you could change one or several of the fields involved to a reference type by adding 'ref' before the type. | ||
|
||
|
||
--CURDIR--/choice_negative.fz:75:5: error 3: Cyclic field nesting is not permitted | ||
A is | ||
----^ | ||
Cyclic value field nesting would result in infinitely large objects. | ||
Cycle of nesting found during clazz layout: | ||
--CURDIR--/choice_negative.fz:76:7: | ||
x i32 | String | A := "Hello" // 6. should flag an error: cyclic choice | ||
------^ | ||
|
||
To solve this, you could change one or several of the fields involved to a reference type by adding 'ref' before the type. | ||
|
||
3 errors. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tests/doubledeclaration_negative/doubledeclaration_negative.fz.expected_err
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
./doubledeclaration2.fz:26:43: error 1: Qualified declaration not allowed for field | ||
public doubledeclaration_negative.cyclic1.a := 4 // 1. should flag an error, field not allowed in qualified declaration | ||
------------------------------------------^ | ||
All fields have to be declared textually within the source of their outer features. | ||
Field declared: 'doubledeclaration_negative.cyclic1.a' | ||
To solve this, you could move the declaration into the implementation of feature 'doubledeclaration_negative.cyclic1'. Alternatively, you can declare a routine instead. | ||
|
||
|
||
./doubledeclaration2.fz:26:43: error 2: Duplicate feature declaration | ||
public doubledeclaration_negative.cyclic1.a := 4 // 1. should flag an error, field not allowed in qualified declaration | ||
------------------------------------------^ | ||
Feature that was declared repeatedly: 'doubledeclaration_negative.cyclic1.a' | ||
originally declared at --CURDIR--/doubledeclaration_negative.fz:29:12: | ||
public a := 3 | ||
-----------^ | ||
To solve this, consider renaming one of these two features, e.g., as 'aʼ' (using a unicode modifier letter apostrophe 'ʼ' U+02BC) or adding an additional argument (e.g. '_ unit' for an ignored unit argument used only to disambiguate these two). | ||
|
||
|
||
./doubledeclaration2.fz:26:43: error 3: Initial value not allowed for feature not embedded in outer feature | ||
public doubledeclaration_negative.cyclic1.a := 4 // 1. should flag an error, field not allowed in qualified declaration | ||
------------------------------------------^ | ||
Fuzion currently does not know when to execute this initializer, so it is forbidden. | ||
To solve this, move the declaration inside another feature or ask the Fuzion team for help. | ||
|
||
|
||
./doubledeclaration2.fz:27:49: error 4: Duplicate feature declaration | ||
public redef doubledeclaration_negative.cyclic1.b => 44 // 2. should flag an error, feature already declared in doubledeclaration_negative.fz | ||
------------------------------------------------^ | ||
Feature that was declared repeatedly: 'doubledeclaration_negative.cyclic1.b' | ||
originally declared at --CURDIR--/doubledeclaration_negative.fz:30:12: | ||
public b => 33 | ||
-----------^ | ||
To solve this, consider renaming one of these two features, e.g., as 'bʼ' (using a unicode modifier letter apostrophe 'ʼ' U+02BC) or adding an additional argument (e.g. '_ unit' for an ignored unit argument used only to disambiguate these two). | ||
|
||
4 errors. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.