From 98f5f021f02456ac496f62af572012387a9777a3 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 28 Jun 2024 15:34:25 +0200 Subject: [PATCH] Improved benchmarks --- bench_test.go | 10 +++++++--- examples/hello/hello.q | 4 ---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bench_test.go b/bench_test.go index d091d84..4bb3f8b 100644 --- a/bench_test.go +++ b/bench_test.go @@ -4,13 +4,15 @@ import ( "testing" "git.akyoto.dev/cli/q/src/build" + "git.akyoto.dev/go/assert" ) func BenchmarkEmpty(b *testing.B) { compiler := build.New("tests/benchmarks/empty.q") for i := 0; i < b.N; i++ { - compiler.Run() + _, err := compiler.Run() + assert.Nil(b, err) } } @@ -18,7 +20,8 @@ func BenchmarkExpressions(b *testing.B) { compiler := build.New("tests/benchmarks/expressions.q") for i := 0; i < b.N; i++ { - compiler.Run() + _, err := compiler.Run() + assert.Nil(b, err) } } @@ -26,6 +29,7 @@ func BenchmarkHello(b *testing.B) { compiler := build.New("examples/hello") for i := 0; i < b.N; i++ { - compiler.Run() + _, err := compiler.Run() + assert.Nil(b, err) } } diff --git a/examples/hello/hello.q b/examples/hello/hello.q index 07f7c6d..c006280 100644 --- a/examples/hello/hello.q +++ b/examples/hello/hello.q @@ -13,8 +13,4 @@ print(address, length) { write(fd, address, length) { syscall(1, fd, address, length) -} - -empty() { - } \ No newline at end of file