From 3e14256b4817c912c47fc32175d693a9c26eeb62 Mon Sep 17 00:00:00 2001 From: Thanh Le Date: Tue, 31 Oct 2023 17:08:53 +0100 Subject: [PATCH] Scala tweak --- bench/src/main/scala/benchmarks/PlayBench.scala | 3 +-- test-kit/src/test/scala/bitboard/BitboardTest.scala | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bench/src/main/scala/benchmarks/PlayBench.scala b/bench/src/main/scala/benchmarks/PlayBench.scala index 4311ecb4c..ee129ee36 100644 --- a/bench/src/main/scala/benchmarks/PlayBench.scala +++ b/bench/src/main/scala/benchmarks/PlayBench.scala @@ -41,10 +41,9 @@ class PlayBench: @Benchmark def divider(bh: Blackhole) = - var result = dividerGames.map { x => + var result = dividerGames.map: x => Blackhole.consumeCPU(Work) Divider(x) - } bh.consume(result) result diff --git a/test-kit/src/test/scala/bitboard/BitboardTest.scala b/test-kit/src/test/scala/bitboard/BitboardTest.scala index 86557ffec..48de39f94 100644 --- a/test-kit/src/test/scala/bitboard/BitboardTest.scala +++ b/test-kit/src/test/scala/bitboard/BitboardTest.scala @@ -11,7 +11,7 @@ class BitboardTest extends ScalaCheckSuite: test("the result of add should contain the added square"): forAll: (bb: Bitboard, square: Square) => - assertEquals((bb.add(square).contains(square)), true) + assertEquals(bb.add(square).contains(square), true) test("Square.bb.singleSquare == Some(square)"): forAll: (square: Square) => @@ -121,7 +121,7 @@ class BitboardTest extends ScalaCheckSuite: test("isDisjoint and intersects always return the opposite value"): forAll: (b1: Bitboard, b2: Bitboard) => - b1.isDisjoint(b2) == !b1.intersects(b2) + b1.isDisjoint(b2) != b1.intersects(b2) property("forall"): forAll: (b: Bitboard, f: Square => Boolean) =>