1
0
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:
Delyan Angelov
2021-05-08 13:32:29 +03:00
committed by GitHub
parent cba2cb6b9c
commit 8a380f4699
132 changed files with 3230 additions and 3440 deletions

View File

@@ -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)