mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tools: make v test-cleancode test everything by default (#10050)
This commit is contained in:
@@ -3,9 +3,7 @@ import time
|
||||
fn do_rec(ch chan int, resch chan i64) {
|
||||
mut sum := i64(0)
|
||||
for {
|
||||
a := <-ch or {
|
||||
break
|
||||
}
|
||||
a := <-ch or { break }
|
||||
sum += a
|
||||
}
|
||||
assert ch.closed == true
|
||||
@@ -32,7 +30,7 @@ fn test_channel_close_buffered_multi() {
|
||||
go do_send(ch)
|
||||
mut sum := i64(0)
|
||||
for _ in 0 .. 4 {
|
||||
sum += <- resch
|
||||
sum += <-resch
|
||||
}
|
||||
assert sum == i64(8000) * (8000 - 1) / 2
|
||||
}
|
||||
@@ -77,9 +75,8 @@ fn test_channel_send_close_buffered() {
|
||||
t := go fn (ch chan int) {
|
||||
ch <- 31
|
||||
mut x := 45
|
||||
ch <- 17 or {
|
||||
x = -133
|
||||
}
|
||||
ch <- 17 or { x = -133 }
|
||||
|
||||
assert x == -133
|
||||
}(ch)
|
||||
time.sleep(100 * time.millisecond)
|
||||
@@ -95,9 +92,8 @@ fn test_channel_send_close_unbuffered() {
|
||||
ch := chan int{}
|
||||
t := go fn (ch chan int) {
|
||||
mut x := 31
|
||||
ch <- 177 or {
|
||||
x = -71
|
||||
}
|
||||
ch <- 177 or { x = -71 }
|
||||
|
||||
assert x == -71
|
||||
}(ch)
|
||||
time.sleep(100 * time.millisecond)
|
||||
|
||||
Reference in New Issue
Block a user