Skip to content

Commit

Permalink
Remove old/unneded tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Jul 16, 2023
1 parent c7b686b commit 39c592a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 215 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ lazy val scalachess = Project("scalachess", file(".")).settings(
"org.scalameta" %% "munit" % "1.0.0-M8" % Test,
"org.scalacheck" %% "scalacheck" % "1.17.0" % Test,
"org.scalameta" %% "munit-scalacheck" % "1.0.0-M8" % Test,
"com.github.lenguyenthanh" % "compression" % "aacf55bea2" % Test, // a fork of lichess compression which public everything so we can use it for testing.
"com.disneystreaming" %% "weaver-cats" % "0.8.3" % Test,
"com.disneystreaming" %% "weaver-scalacheck" % "0.8.3" % Test,
"co.fs2" %% "fs2-core" % "3.7.0" % Test,
Expand Down
83 changes: 0 additions & 83 deletions src/test/scala/bitboard/BitboardTest.scala

This file was deleted.

31 changes: 1 addition & 30 deletions src/test/scala/bitboard/BoardTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package bitboard
import munit.FunSuite

import Square.*
import Helpers.*
import Bitboard.*
import chess.format.Fen
import chess.format.EpdFen
Expand All @@ -13,28 +12,11 @@ class BoardTest extends FunSuite:

import scala.language.implicitConversions
given Conversion[Square, Int] = _.value
given Conversion[Int, Square] = Square.at(_).get
given Conversion[Int, Square] = Square(_)

def parseFen(fen: EpdFen): Board =
Fen.read(fen).map(_.board.board).getOrElse(throw RuntimeException("boooo"))

test("sliderBlockers"):
for
fen <- FenFixtures.fens
situation = Fen.read(fen).getOrElse(throw RuntimeException("boooo"))
king = situation.ourKings.head
result = situation.board.sliderBlockers(king, situation.color)
expected = situation.cBoard.sliderBlockers(king)
yield assertEquals(result, Bitboard(expected))

test("generateMoves = generateMovesAt for all square"):
for
fen <- FenFixtures.fens
situation = Fen.read(fen).getOrElse(throw RuntimeException("boooo"))
legalMoves = situation.legalMoves
legalMovesAll = Square.all.flatMap(situation.generateMovesAt(_))
yield assertEquals(legalMoves.toSet, legalMovesAll.toSet)

test("generateMovesAt(square) = generateMoves.filter(_.orig == square)"):
for
fen <- FenFixtures.fens
Expand All @@ -44,17 +26,6 @@ class BoardTest extends FunSuite:
legalMovesAt = situation.generateMovesAt(sq)
yield assertEquals(legalMoves.toSet, legalMovesAt.toSet)

test("attacksTo"):
for
str <- FenFixtures.fens
fen = Fen.read(str).getOrElse(throw RuntimeException("boooo"))
king = fen.ourKings.head
sq <- Square.all
color <- List(Color.White, Color.Black)
result = fen.board.attackers(sq, color)
expected = fen.cBoard.attacksTo(sq, color.white)
yield assertEquals(result, Bitboard(expected))

test("discard an empty square returns the same board"):
for
str <- FenFixtures.fens
Expand Down
65 changes: 0 additions & 65 deletions src/test/scala/bitboard/Helpers.scala

This file was deleted.

36 changes: 0 additions & 36 deletions src/test/scala/bitboard/Move.scala

This file was deleted.

0 comments on commit 39c592a

Please sign in to comment.