Skip to content

Commit fa66ab6

Browse files
waterlensbobzhang
authored andcommitted
fix: remove bench test to pass stable-check
1 parent 342af47 commit fa66ab6

File tree

2 files changed

+1
-51
lines changed

2 files changed

+1
-51
lines changed

test/test.mbt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,7 @@ fn iter_count[Any](inner : () -> Any, count : UInt) -> Summary {
182182
}
183183
184184
///|
185-
pub fn bench(
186-
self : T,
187-
f : () -> Unit,
188-
count~ : UInt = 10
189-
) -> Unit!BenchError {
185+
pub fn bench(self : T, f : () -> Unit, count~ : UInt = 10) -> Unit!BenchError {
190186
ignore(self)
191187
let summary = iter_count(f, count)
192188
raise BenchError("@BENCH \{summary.to_json().stringify()}\n")

test/test_test.mbt

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -37,49 +37,3 @@ test "panic is_not called with the same object" {
3737
let s = "Hello"
3838
@test.is_not!(s, s)
3939
}
40-
41-
///|
42-
test "bench: sum inside test" (it : @test.T) {
43-
it.bench!(
44-
fn() {
45-
let mut i = 0.0
46-
while i < 100000 {
47-
i += 1.0
48-
}
49-
ignore(i)
50-
},
51-
count=5,
52-
)
53-
}
54-
55-
///|
56-
test "bench: only first bench should run" (it : @test.T) {
57-
it.bench!(
58-
fn() {
59-
let mut i = 0.0
60-
while i < 10000000 {
61-
i += 1.0
62-
}
63-
ignore(i)
64-
},
65-
count=5,
66-
)
67-
it.bench!(fn() { panic() })
68-
}
69-
70-
///|
71-
test "monotonic clock" {
72-
let ts = monotonic_clock_start()
73-
// use sum to avoid optimization
74-
let mut sum : Double = 0
75-
for i in 0..=100000 {
76-
sum += i.to_double()
77-
}
78-
// explicitly output something
79-
println("monotonic clock test")
80-
let diff = monotonic_clock_end(ts)
81-
println("monotonic clock elapsed time: \{diff} us")
82-
assert_true!(diff > 0.0)
83-
assert_false!(diff.is_nan())
84-
inspect!(sum, content="5000050000")
85-
}

0 commit comments

Comments
 (0)