-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests and move some tests from typechecker to symbol table g…
…enerator (#367)
- Loading branch information
1 parent
d6396bb
commit e5bb859
Showing
45 changed files
with
112 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#![core.linker.flag] | ||
type T dyn; | ||
type T int|double; | ||
|
||
f<int> main() {} |
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
2 changes: 1 addition & 1 deletion
2
...iases/error-duplicate-alias/exception.out → ...iases/error-duplicate-alias/exception.out
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
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
test/test-files/symboltablebuilder/enums/error-duplicate-enum-def/exception.out
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,5 @@ | ||
[Error|Semantic] ./test-files/symboltablebuilder/enums/error-duplicate-enum-def/source.spice:7:1: | ||
Duplicate symbol: Duplicate symbol 'Fruit' | ||
|
||
7 type Fruit enum { | ||
^^^^^^^^^^^^^^^^^ |
13 changes: 13 additions & 0 deletions
13
test/test-files/symboltablebuilder/enums/error-duplicate-enum-def/source.spice
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,13 @@ | ||
type Fruit enum { | ||
Apple, | ||
Banana, | ||
Orange | ||
} | ||
|
||
type Fruit enum { | ||
Kiwi, | ||
Mango, | ||
Pear | ||
} | ||
|
||
f<int> main() {} |
2 changes: 1 addition & 1 deletion
2
...s/error-duplicate-item-name/exception.out → ...s/error-duplicate-item-name/exception.out
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
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
test/test-files/symboltablebuilder/ext-decl/error-duplicate-ext-decl/exception.out
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,5 @@ | ||
[Error|Semantic] ./test-files/symboltablebuilder/ext-decl/error-duplicate-ext-decl/source.spice:2:1: | ||
Duplicate symbol: Duplicate symbol 'malloc' | ||
|
||
2 ext f<heap byte*> malloc(unsigned long); | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
4 changes: 4 additions & 0 deletions
4
test/test-files/symboltablebuilder/ext-decl/error-duplicate-ext-decl/source.spice
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,4 @@ | ||
ext f<heap byte*> malloc(unsigned long); | ||
ext f<heap byte*> malloc(unsigned long); | ||
|
||
f<int> main() {} |
2 changes: 1 addition & 1 deletion
2
...rror-duplicate-function-def/exception.out → ...rror-duplicate-function-def/exception.out
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...duplicate-main-function-def/exception.out → ...duplicate-main-function-def/exception.out
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../error-method-before-struct/exception.out → .../error-method-before-struct/exception.out
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
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
test/test-files/symboltablebuilder/functions/error-must-contain-main-function/exception.out
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,2 @@ | ||
[Error|Semantic] ./test-files/symboltablebuilder/functions/error-must-contain-main-function/source.spice:1:1: | ||
Spice programs must contain a main function: No main function found |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
test/test-files/symboltablebuilder/generics/error-duplicate-gen-type-def/exception.out
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,5 @@ | ||
[Error|Semantic] ./test-files/symboltablebuilder/generics/error-duplicate-gen-type-def/source.spice:2:1: | ||
Duplicate symbol: Duplicate symbol 'T' | ||
|
||
2 type T int|double; | ||
^^^^^^^^^^^^^^^^^^ |
4 changes: 4 additions & 0 deletions
4
test/test-files/symboltablebuilder/generics/error-duplicate-gen-type-def/source.spice
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,4 @@ | ||
type T dyn; | ||
type T int|double; | ||
|
||
f<int> main() {} |
2 changes: 1 addition & 1 deletion
2
...bal-var-decl-twice-external/exception.out → ...bal-var-decl-twice-external/exception.out
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...error-global-var-decl-twice/exception.out → ...error-global-var-decl-twice/exception.out
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
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
test/test-files/symboltablebuilder/interfaces/error-duplicate-interface-def/exception.out
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,5 @@ | ||
[Error|Semantic] ./test-files/symboltablebuilder/interfaces/error-duplicate-interface-def/source.spice:5:1: | ||
Duplicate symbol: Duplicate symbol 'Person' | ||
|
||
5 type Person interface { | ||
^^^^^^^^^^^^^^^^^^^^^^^ |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ror-duplicate-procedure-def/exception.out → ...ror-duplicate-procedure-def/exception.out
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
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
test/test-files/symboltablebuilder/structs/error-duplicate-field/exception.out
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,5 @@ | ||
[Error|Semantic] ./test-files/symboltablebuilder/structs/error-duplicate-field/source.spice:4:5: | ||
Multiple declarations of the same variable: The field 'a' was declared more than once | ||
|
||
4 string a | ||
^^^^^^^^ |
7 changes: 7 additions & 0 deletions
7
test/test-files/symboltablebuilder/structs/error-duplicate-field/source.spice
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,7 @@ | ||
type TestStruct struct { | ||
long a | ||
short b | ||
string a | ||
} | ||
|
||
f<int> main() {} |
5 changes: 5 additions & 0 deletions
5
test/test-files/symboltablebuilder/structs/error-duplicate-struct-def/exception.out
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,5 @@ | ||
[Error|Semantic] ./test-files/symboltablebuilder/structs/error-duplicate-struct-def/source.spice:7:1: | ||
Duplicate symbol: Duplicate symbol 'Person' | ||
|
||
7 type Person struct { | ||
^^^^^^^^^^^^^^^^^^^^ |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...es/error-variable-ambiguity/exception.out → ...es/error-variable-ambiguity/exception.out
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...-declared-before-referenced/exception.out → ...-declared-before-referenced/exception.out
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...variable-declared-only-once/exception.out → ...variable-declared-only-once/exception.out
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
File renamed without changes.
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
2 changes: 0 additions & 2 deletions
2
test/test-files/typechecker/functions/error-must-contain-main-function/exception.out
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
test/test-files/typechecker/interfaces/error-duplicate-interface-def/exception.out
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
test/test-files/typechecker/structs/error-duplicate-struct-def/exception.out
This file was deleted.
Oops, something went wrong.