Skip to content

Commit

Permalink
fastjet: embed test files to speedup race tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Binet <binet@cern.ch>
  • Loading branch information
sbinet committed Feb 18, 2025
1 parent 34c208f commit 2b7bcba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fastjet/algorithm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"bufio"
"fmt"
"math"
"os"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -365,7 +364,7 @@ func TestExclusiveJetAlgorithms(t *testing.T) {
}

func loadParticles(name string) ([]fastjet.Jet, error) {
f, err := os.Open(name)
f, err := testFS.Open(name)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -408,7 +407,7 @@ func loadParticles(name string) ([]fastjet.Jet, error) {
}

func loadRef(name string) ([][3]float64, error) {
f, err := os.Open(name)
f, err := testFS.Open(name)
if err != nil {
return nil, err
}
Expand Down
4 changes: 4 additions & 0 deletions fastjet/fastjet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
package fastjet_test

import (
"embed"
"sort"
"testing"

"go-hep.org/x/hep/fastjet"
"go-hep.org/x/hep/fmom"
)

//go:embed testdata/*.ref testdata/*.dat
var testFS embed.FS

func TestSimple(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 2b7bcba

Please sign in to comment.