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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
132 changed files with 3230 additions and 3440 deletions

View file

@ -7,7 +7,7 @@ fn do_select(ch1 chan int, ch2 chan int, chf1 chan f64, chf2 chan f64, sumch1 ch
mut sum1 := i64(0)
mut sum2 := i64(0)
f1 := 17.
f2 := 7.
f2 := 7.
for _ in 0 .. 20000 + chf1.cap / 3 {
select {
chf1 <- f1 {}
@ -31,7 +31,7 @@ fn do_send_int(ch chan int, factor int) {
}
fn do_rec_f64(ch chan f64, sumch chan f64) {
mut sum:= 0.
mut sum := 0.
for _ in 0 .. 10000 {
sum += <-ch
}
@ -67,7 +67,7 @@ fn test_select() {
}
sumf2 := <-chsumf2 + <-chsumf2
// Use Gauß' formula
expected_sum := i64(10000) * (10000 - 1) / 2
expected_sum := i64(10000) * (10000 - 1) / 2
assert sum1 == 3 * expected_sum
assert sum2 == (7 + 17) * expected_sum
assert sumf1 == 17. * f64(10000 + chf1.cap)