-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package all_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/go-sprout/sprout/group/all" | ||
"github.com/go-sprout/sprout/pesticide" | ||
) | ||
|
||
func TestRegistryGroup(t *testing.T) { | ||
tc := pesticide.GroupTestCase{ | ||
RegistriesUIDs: []string{ | ||
"go-sprout/sprout.checksum", | ||
"go-sprout/sprout.conversion", | ||
"go-sprout/sprout.encoding", | ||
"go-sprout/sprout.env", | ||
"go-sprout/sprout.filesystem", | ||
"go-sprout/sprout.maps", | ||
"go-sprout/sprout.network", | ||
"go-sprout/sprout.numeric", | ||
"go-sprout/sprout.random", | ||
"go-sprout/sprout.reflect", | ||
"go-sprout/sprout.regexp", | ||
"go-sprout/sprout.semver", | ||
"go-sprout/sprout.slices", | ||
"go-sprout/sprout.std", | ||
"go-sprout/sprout.strings", | ||
"go-sprout/sprout.time", | ||
"go-sprout/sprout.uniqueid", | ||
}, | ||
} | ||
|
||
pesticide.RunGroupTest(t, all.RegistryGroup(), tc) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package hermetic_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/go-sprout/sprout/group/hermetic" | ||
"github.com/go-sprout/sprout/pesticide" | ||
) | ||
|
||
func TestRegistryGroup(t *testing.T) { | ||
tc := pesticide.GroupTestCase{ | ||
RegistriesUIDs: []string{ | ||
"go-sprout/sprout.checksum", | ||
"go-sprout/sprout.conversion", | ||
"go-sprout/sprout.encoding", | ||
"go-sprout/sprout.filesystem", | ||
"go-sprout/sprout.maps", | ||
"go-sprout/sprout.numeric", | ||
"go-sprout/sprout.reflect", | ||
"go-sprout/sprout.regexp", | ||
"go-sprout/sprout.semver", | ||
"go-sprout/sprout.slices", | ||
"go-sprout/sprout.std", | ||
"go-sprout/sprout.strings", | ||
"go-sprout/sprout.time", | ||
"go-sprout/sprout.uniqueid", | ||
}, | ||
} | ||
|
||
pesticide.RunGroupTest(t, hermetic.RegistryGroup(), tc) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package pesticide | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/go-sprout/sprout" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
type GroupTestCase struct { | ||
RegistriesUIDs []string | ||
} | ||
|
||
func RunGroupTest(t *testing.T, rg *sprout.RegistryGroup, tc GroupTestCase) { | ||
t.Helper() | ||
|
||
require.NotNil(t, rg, "RegistryGroup should not be nil") | ||
require.NotNil(t, rg.Registries, "RegistryGroup.Registries should not be nil") | ||
|
||
require.Len(t, rg.Registries, len(tc.RegistriesUIDs), "The number of registries should match the number of expected registries") | ||
|
||
for _, registry := range rg.Registries { | ||
assert.Contains(t, tc.RegistriesUIDs, registry.UID(), "Registry UID %s aren't excepted", registry.UID()) | ||
} | ||
} |
File renamed without changes.