Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fastjet: embed test files to speedup race tests #1034

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading