Fix generated types for pkg/actionlog
This commit is contained in:
+2
-2
@@ -104,8 +104,8 @@ function types {
|
||||
./build/gen-type-set --types Script --output pkg/corredor/types.gen.go --with-primary-key=false --package corredor
|
||||
./build/gen-type-set-test --types Script --output pkg/corredor/types.gen_test.go --with-primary-key=false --package corredor
|
||||
|
||||
./build/gen-type-set --types Action --output pkg/auditlog/types.gen.go --with-primary-key=false --package auditlog
|
||||
./build/gen-type-set-test --types Action --output pkg/auditlog/types.gen_test.go --with-primary-key=false --package auditlog
|
||||
./build/gen-type-set --types Action --output pkg/actionlog/types.gen.go --with-primary-key=false --package actionlog
|
||||
./build/gen-type-set-test --types Action --output pkg/actionlog/types.gen_test.go --with-primary-key=false --package actionlog
|
||||
|
||||
|
||||
green "OK"
|
||||
|
||||
@@ -10,34 +10,34 @@ import (
|
||||
|
||||
// Hello! This file is auto-generated.
|
||||
|
||||
func TestEventSetWalk(t *testing.T) {
|
||||
func TestActionSetWalk(t *testing.T) {
|
||||
var (
|
||||
value = make(EventSet, 3)
|
||||
value = make(ActionSet, 3)
|
||||
req = require.New(t)
|
||||
)
|
||||
|
||||
// check walk with no errors
|
||||
{
|
||||
err := value.Walk(func(*Event) error {
|
||||
err := value.Walk(func(*Action) error {
|
||||
return nil
|
||||
})
|
||||
req.NoError(err)
|
||||
}
|
||||
|
||||
// check walk with error
|
||||
req.Error(value.Walk(func(*Event) error { return errors.New("walk error") }))
|
||||
req.Error(value.Walk(func(*Action) error { return errors.New("walk error") }))
|
||||
|
||||
}
|
||||
|
||||
func TestEventSetFilter(t *testing.T) {
|
||||
func TestActionSetFilter(t *testing.T) {
|
||||
var (
|
||||
value = make(EventSet, 3)
|
||||
value = make(ActionSet, 3)
|
||||
req = require.New(t)
|
||||
)
|
||||
|
||||
// filter nothing
|
||||
{
|
||||
set, err := value.Filter(func(*Event) (bool, error) {
|
||||
set, err := value.Filter(func(*Action) (bool, error) {
|
||||
return true, nil
|
||||
})
|
||||
req.NoError(err)
|
||||
@@ -47,7 +47,7 @@ func TestEventSetFilter(t *testing.T) {
|
||||
// filter one item
|
||||
{
|
||||
found := false
|
||||
set, err := value.Filter(func(*Event) (bool, error) {
|
||||
set, err := value.Filter(func(*Action) (bool, error) {
|
||||
if !found {
|
||||
found = true
|
||||
return found, nil
|
||||
@@ -60,7 +60,7 @@ func TestEventSetFilter(t *testing.T) {
|
||||
|
||||
// filter error
|
||||
{
|
||||
_, err := value.Filter(func(*Event) (bool, error) {
|
||||
_, err := value.Filter(func(*Action) (bool, error) {
|
||||
return false, errors.New("filter error")
|
||||
})
|
||||
req.Error(err)
|
||||
|
||||
Reference in New Issue
Block a user