Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

Commit

Permalink
simplified tests
Browse files Browse the repository at this point in the history
  • Loading branch information
notnil committed Nov 24, 2024
1 parent 04472d9 commit e5d38fb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pgn_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package chess

import (
"fmt"
"io"
"io/ioutil"
"os"
"strings"
Expand Down Expand Up @@ -138,11 +136,11 @@ func TestWriteComments(t *testing.T) {
}

func TestScanner(t *testing.T) {
m := map[string]int{
"fixtures/pgns/0006.pgn":5,
"fixtures/pgns/0007.pgn":5,
"fixtures/pgns/0013.pgn":3,
}
m := map[string]int{
"fixtures/pgns/0006.pgn": 5,
"fixtures/pgns/0007.pgn": 5,
"fixtures/pgns/0013.pgn": 3,
}
for fname, count := range m {
f, err := os.Open(fname)
if err != nil {
Expand All @@ -153,6 +151,9 @@ func TestScanner(t *testing.T) {
games := []*Game{}
for scanner.Scan() {
game := scanner.Next()
if len(game.Moves()) == 0 {
continue
}
games = append(games, game)
}
if len(games) != count {
Expand Down

0 comments on commit e5d38fb

Please sign in to comment.