Skip to content

Commit

Permalink
Add a test of OCR letters utility
Browse files Browse the repository at this point in the history
  • Loading branch information
devries committed Sep 6, 2023
1 parent 6e13be0 commit 7572319
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,20 @@ func TestReadLines(t *testing.T) {
}
}
}

func TestOCR(t *testing.T) {
input := `###..###..###...##..###...##...##..####.
#..#.#..#.#..#.#..#.#..#.#..#.#..#.#....
#..#.###..#..#.#..#.#..#.#..#.#....###..
###..#..#.###..####.###..####.#.##.#....
#.#..#..#.#....#..#.#.#..#..#.#..#.#....
#..#.###..#....#..#.#..#.#..#..###.#....`

wanted := "RBPARAGF"

obtained := OCRLetters(input)

if strings.Compare(wanted, obtained) != 0 {
t.Errorf("Expected %s, got %s", wanted, obtained)
}
}

0 comments on commit 7572319

Please sign in to comment.