fix diff round-trip comparison
This commit is contained in:
@@ -2,6 +2,7 @@ package pgsql
|
||||
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
@@ -359,6 +360,14 @@ func TestDeriveRelationship(t *testing.T) {
|
||||
t.Errorf("Expected ToTable 'users', got '%s'", rel.ToTable)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(rel.FromColumns, []string{"user_id"}) {
|
||||
t.Errorf("Expected FromColumns [user_id], got %v", rel.FromColumns)
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(rel.ToColumns, []string{"id"}) {
|
||||
t.Errorf("Expected ToColumns [id], got %v", rel.ToColumns)
|
||||
}
|
||||
|
||||
if rel.ForeignKey != "fk_orders_user_id" {
|
||||
t.Errorf("Expected ForeignKey 'fk_orders_user_id', got '%s'", rel.ForeignKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user