diff --git a/test-kit/src/test/scala/DividerTest.scala b/test-kit/src/test/scala/DividerTest.scala index 80aec8c01..b2e70b5e1 100644 --- a/test-kit/src/test/scala/DividerTest.scala +++ b/test-kit/src/test/scala/DividerTest.scala @@ -6,7 +6,7 @@ import MoveOrDrop.* class DividerTest extends ChessTest: def makeReplay(moves: String) = - format.pgn.Reader.full(moves).toOption.get match + format.pgn.Reader.full(moves).get match case format.pgn.Reader.Result.Complete(replay) => replay.chronoMoves.map(_.fold(_.before, _.before)) case x => sys error s"Unexpected incomplete replay $x" diff --git a/test-kit/src/test/scala/format/pgn/DumperTest.scala b/test-kit/src/test/scala/format/pgn/DumperTest.scala index 9b98fa7e2..884d2b251 100644 --- a/test-kit/src/test/scala/format/pgn/DumperTest.scala +++ b/test-kit/src/test/scala/format/pgn/DumperTest.scala @@ -14,7 +14,7 @@ class DumperTest extends ChessTest: test("Check with pawn not be checkmate if pawn can be taken en passant"): val game = Fen.readWithMoveNumber(EpdFen("8/3b4/6R1/1P2kp2/6pp/2N1P3/4KPPP/8 w - -")).get match case s: Situation.AndFullMoveNumber => Game(s.situation, ply = s.ply) - val move = game(Square.F2, Square.F4).toOption.get._2 + val move = game(Square.F2, Square.F4).get._2 assertEquals(Dumper(move), "f4+") val gioachineGreco = makeGame.playMoves( @@ -338,5 +338,5 @@ NRKNRQBB val fen = EpdFen("r5k1/1b5p/N3p1p1/Q4p2/4r3/2P1q3/1PK2RP1/5R2 w - - 1 38") val sit = Fen.read(fen).get val game1 = Game(sit.board, sit.color) - val (game2, move) = game1(Square.F2, Square.F3).toOption.get + val (game2, move) = game1(Square.F2, Square.F3).get assertEquals(Dumper(game1.situation, move, game2.situation), "Rf3") diff --git a/test-kit/src/test/scala/format/pgn/ParserCheck.scala b/test-kit/src/test/scala/format/pgn/ParserCheck.scala index cd22eea0a..c07a4e6ce 100644 --- a/test-kit/src/test/scala/format/pgn/ParserCheck.scala +++ b/test-kit/src/test/scala/format/pgn/ParserCheck.scala @@ -13,5 +13,5 @@ class ParserCheck extends ScalaCheckSuite: test("ParserCheck"): forAll(genPgn(Situation(Standard))): pgn => val str = pgn.render - val result = Parser.full(str).toOption.get.toPgn.render + val result = Parser.full(str).get.toPgn.render assertEquals(result, str) diff --git a/test-kit/src/test/scala/format/pgn/RenderTest.scala b/test-kit/src/test/scala/format/pgn/RenderTest.scala index c4469f01b..398e66e09 100644 --- a/test-kit/src/test/scala/format/pgn/RenderTest.scala +++ b/test-kit/src/test/scala/format/pgn/RenderTest.scala @@ -32,21 +32,21 @@ class RenderTest extends ChessTest: test("pgn round trip tests compare ParsedPgn"): (pgns ++ wcc2023).foreach: x => - val pgn = Parser.full(x).toOption.get - val output = Parser.full(pgn.toPgn.render).toOption.get + val pgn = Parser.full(x).get + val output = Parser.full(pgn.toPgn.render).get assertEquals(output.cleanTags, pgn.cleanTags) test("pgn round trip tests compare Pgn"): List(pgn1, pgn3).foreach: x => - val result = Parser.full(x).toOption.get.toPgn.render + val result = Parser.full(x).get.toPgn.render assertEquals(result.value, x) test("pgn round trip tests compare ouput"): - val results = pgns.map(Parser.full(_).toOption.get.toPgn.render).mkString("\n\n") + val results = pgns.map(Parser.full(_).get.toPgn.render).mkString("\n\n") assertEquals(results, ouput) test("wcc2023 study round trip tests"): - val results = wcc2023.map(Parser.full(_).toOption.get.toPgn.render).mkString("\n\n") + val results = wcc2023.map(Parser.full(_).get.toPgn.render).mkString("\n\n") assertEquals(results, ouput2) val pgn1 = """ diff --git a/test-kit/src/test/scala/opening/OpeningTest.scala b/test-kit/src/test/scala/opening/OpeningTest.scala index 93637467c..6b1ed93ba 100644 --- a/test-kit/src/test/scala/opening/OpeningTest.scala +++ b/test-kit/src/test/scala/opening/OpeningTest.scala @@ -46,7 +46,7 @@ class OpeningTest extends ChessTest: assertEquals(searchStr("d4 c5 d5 e5").get.name, OpeningName("Benoni Defense: Old Benoni")) test("search should find by replay in d4"): - val replay = Replay(List(SanStr("d4")), None, variant.Standard).toOption.get.valid.toOption.get + val replay = Replay(List(SanStr("d4")), None, variant.Standard).get.valid.get val op = OpeningDb.search(replay).get assertEquals(op.opening.name, OpeningName("Queen's Pawn Game")) assertEquals(op.ply, Ply(1)) @@ -58,7 +58,7 @@ class OpeningTest extends ChessTest: .toList, None, variant.Standard - ).toOption.get.valid.toOption.get + ).get.valid.get val op = OpeningDb.search(replay).get assertEquals(op.opening.name, OpeningName("King's Gambit Accepted: Muzio Gambit, Holloway Defense")) assertEquals(op.ply, Ply(12))