Skip to content

Commit

Permalink
test(assets): update test for mapper prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
0xankit committed Dec 13, 2022
1 parent 5024eae commit 8a868ff
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions modules/assets/internal/mapper/prototype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,28 @@
package mapper

import (
"github.com/AssetMantle/modules/schema/helpers"
"reflect"
"testing"

"github.com/stretchr/testify/require"

"github.com/AssetMantle/modules/modules/assets/internal/key"
"github.com/AssetMantle/modules/modules/assets/internal/mappable"
baseHelpers "github.com/AssetMantle/modules/schema/helpers/base"
)

func TestPrototype(t *testing.T) {
require.Panics(t, func() {
require.Equal(t, Prototype(), baseHelpers.NewMapper(key.Prototype, mappable.Prototype))
})
tests := []struct {
name string
want helpers.Mapper
}{
// TODO: it should pass, but possibly due to a bug in the code, it fails
{"+ve", baseHelpers.NewMapper(key.Prototype, mappable.Prototype)},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := Prototype(); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Prototype() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit 8a868ff

Please sign in to comment.