Skip to content

Commit

Permalink
Fix paralleltest lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bodgit committed Apr 30, 2022
1 parent 8207a2f commit e4d5ed4
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,34 @@ import (
)

func TestOpenReader(t *testing.T) {
tables := map[string]struct {
file string
t.Parallel()

tables := []struct {
name, file string
}{
"no header compression": {
{
name: "no header compression",
file: "t0.7z",
},
"with header compression": {
{
name: "with header compression",
file: "t1.7z",
},
"multiple volume": {
{
name: "multiple volume",
file: "multi.7z.001",
},
"empty streams and files": {
{
name: "empty streams and files",
file: "empty.7z",
},
}

for name, table := range tables {
t.Run(name, func(t *testing.T) {
for _, table := range tables {
table := table

t.Run(table.name, func(t *testing.T) {
t.Parallel()
r, err := OpenReader(filepath.Join("testdata", table.file))
if err != nil {
t.Fatal(err)
Expand All @@ -39,22 +48,28 @@ func TestOpenReader(t *testing.T) {
}

func TestOpenReaderWithPassword(t *testing.T) {
tables := map[string]struct {
file string
password string
t.Parallel()

tables := []struct {
name, file, password string
}{
"no header compression": {
{
name: "no header compression",
file: "t2.7z",
password: "password",
},
"with header compression": {
{
name: "with header compression",
file: "t3.7z",
password: "password",
},
}

for name, table := range tables {
t.Run(name, func(t *testing.T) {
for _, table := range tables {
table := table

t.Run(table.name, func(t *testing.T) {
t.Parallel()
r, err := OpenReaderWithPassword(filepath.Join("testdata", table.file), table.password)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit e4d5ed4

Please sign in to comment.