-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gnovm): move invalid labels tests to tests/files/ (#2058)
- Loading branch information
Showing
5 changed files
with
53 additions
and
86 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,14 @@ | ||
package main | ||
|
||
func main() {} | ||
func invalidLabel() { | ||
FirstLoop: | ||
for i := 0; i < 10; i++ { | ||
} | ||
for i := 0; i < 10; i++ { | ||
break FirstLoop | ||
} | ||
} | ||
|
||
// Error: | ||
// main/files/invalid_labels0.gno:9: cannot find branch label "FirstLoop" |
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,12 @@ | ||
package main | ||
|
||
func main() {} | ||
|
||
func undefinedLabel() { | ||
for i := 0; i < 10; i++ { | ||
break UndefinedLabel | ||
} | ||
} | ||
|
||
// Error: | ||
// files/invalid_labels1.gno:7:9: label UndefinedLabel undefined |
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,15 @@ | ||
package main | ||
|
||
func main() {} | ||
|
||
func labelOutsideScope() { | ||
for i := 0; i < 10; i++ { | ||
continue FirstLoop | ||
} | ||
FirstLoop: | ||
for i := 0; i < 10; i++ { | ||
} | ||
} | ||
|
||
// Error: | ||
// main/files/invalid_labels2.gno:7: cannot find branch label "FirstLoop" |
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,12 @@ | ||
package main | ||
|
||
func main() {} | ||
|
||
func invalidLabelStatement() { | ||
if true { | ||
break InvalidLabel | ||
} | ||
} | ||
|
||
// Error: | ||
// files/invalid_labels3.gno:7:9: label InvalidLabel undefined |