tests: cleanup vlib/v/checker/tests/run ; add unused_variable_warning.vv
parent
e8909cced0
commit
0801f88d0a
|
@ -0,0 +1,13 @@
|
|||
vlib/v/checker/tests/assign_expr_unresolved_variables_err_chain.vv:2:7: error: undefined variable `b` (used before declaration)
|
||||
1 | fn main() {
|
||||
2 | a := b
|
||||
| ^
|
||||
3 | b := c
|
||||
4 | c := a
|
||||
vlib/v/checker/tests/assign_expr_unresolved_variables_err_chain.vv:3:7: error: undefined variable `c` (used before declaration)
|
||||
1 | fn main() {
|
||||
2 | a := b
|
||||
3 | b := c
|
||||
| ^
|
||||
4 | c := a
|
||||
5 | }
|
|
@ -1,13 +0,0 @@
|
|||
vlib/v/checker/tests/run/assign_expr_unresolved_variables_err_chain.vv:2:7: error: undefined variable `b` (used before declaration)
|
||||
1 | fn main() {
|
||||
2 | a := b
|
||||
| ^
|
||||
3 | b := c
|
||||
4 | c := a
|
||||
vlib/v/checker/tests/run/assign_expr_unresolved_variables_err_chain.vv:3:7: error: undefined variable `c` (used before declaration)
|
||||
1 | fn main() {
|
||||
2 | a := b
|
||||
3 | b := c
|
||||
| ^
|
||||
4 | c := a
|
||||
5 | }
|
|
@ -0,0 +1,15 @@
|
|||
vlib/v/checker/tests/run/unused_variable_warning.vv:3:2: warning: unused variable: `a`
|
||||
1 | // NB: this test should compile and run, but it also should produce a compiler warning.
|
||||
2 | fn main() {
|
||||
3 | a := 1
|
||||
| ^
|
||||
4 | b := 2
|
||||
5 | println('hello')
|
||||
vlib/v/checker/tests/run/unused_variable_warning.vv:4:2: warning: unused variable: `b`
|
||||
2 | fn main() {
|
||||
3 | a := 1
|
||||
4 | b := 2
|
||||
| ^
|
||||
5 | println('hello')
|
||||
6 | }
|
||||
hello
|
|
@ -0,0 +1,6 @@
|
|||
// NB: this test should compile and run, but it also should produce a compiler warning.
|
||||
fn main() {
|
||||
a := 1
|
||||
b := 2
|
||||
println('hello')
|
||||
}
|
Loading…
Reference in New Issue