Skip to content

Commit

Permalink
Set a tolerance for a unit test because the number of proteins change…
Browse files Browse the repository at this point in the history
…s slightly from version to version.
  • Loading branch information
fcyu committed Jan 28, 2024
1 parent d718882 commit c73c0cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/dat/dat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dat_test

import (
"github.com/Nesvilab/philosopher/lib/fas"
"math"
"testing"

. "github.com/Nesvilab/philosopher/lib/dat"
Expand Down Expand Up @@ -68,8 +69,8 @@ func TestBase_ProcessDB(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
len_records := ParseFile(tt.args.file, make(chan<- []fas.FastaEntry, 1024))
if len_records != 20413 {
t.Errorf("Number of FASTA entries is incorrect, got %d, want %d", len_records, 20413)
if math.Abs(float64(len_records-20413)) > 100 {
t.Errorf("Number of FASTA entries is incorrect, got %d, want around %d", len_records, 20413)
}
})
}
Expand Down

0 comments on commit c73c0cd

Please sign in to comment.