Skip to content

Commit

Permalink
Use enginetest/stubs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Sep 24, 2024
1 parent fa8211e commit 1bfa701
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package configkit_test

import (
. "github.com/dogmatiq/configkit"
"github.com/dogmatiq/configkit/message" // can't dot-import due to conflicts
"github.com/dogmatiq/configkit/message"
. "github.com/dogmatiq/enginekit/enginetest/stubs"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
Expand Down
2 changes: 1 addition & 1 deletion handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package configkit_test

import (
. "github.com/dogmatiq/configkit"
"github.com/dogmatiq/dogma" // can't dot-import due to conflicts
"github.com/dogmatiq/dogma"
. "github.com/dogmatiq/enginekit/enginetest/stubs"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
Expand Down
2 changes: 1 addition & 1 deletion handlerset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
. "github.com/dogmatiq/configkit"
"github.com/dogmatiq/configkit/fixtures"
"github.com/dogmatiq/configkit/message"
"github.com/dogmatiq/dogma" // can't dot-import due to conflicts
"github.com/dogmatiq/dogma"
. "github.com/dogmatiq/enginekit/enginetest/stubs"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
Expand Down
2 changes: 1 addition & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
. "github.com/dogmatiq/configkit"
"github.com/dogmatiq/configkit/fixtures" // can't dot-import due to conflicts
"github.com/dogmatiq/configkit/message"
"github.com/dogmatiq/dogma" // can't dot-import due to conflicts
"github.com/dogmatiq/dogma"
. "github.com/dogmatiq/enginekit/enginetest/stubs"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
Expand Down
39 changes: 19 additions & 20 deletions message/typeset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package message_test

import (
. "github.com/dogmatiq/configkit/message"
"github.com/dogmatiq/dogma/fixtures"
. "github.com/dogmatiq/enginekit/enginetest/stubs"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
Expand Down Expand Up @@ -74,49 +73,49 @@ var _ = Describe("type TypeSet", func() {
})

It("returns the original set if a single set is given", func() {
a := TypesOf(fixtures.MessageA1, fixtures.MessageB1)
a := TypesOf(CommandA1, CommandB1)
Expect(UnionT(a)).To(Equal(a))
})

It("returns the original set for identical sets", func() {
a := TypesOf(fixtures.MessageA1, fixtures.MessageB1)
b := TypesOf(fixtures.MessageA1, fixtures.MessageB1)
c := TypesOf(fixtures.MessageA1, fixtures.MessageB1)
a := TypesOf(CommandA1, CommandB1)
b := TypesOf(CommandA1, CommandB1)
c := TypesOf(CommandA1, CommandB1)
Expect(UnionT(a, b, c)).To(Equal(a))
})

It("returns the union", func() {
a := TypesOf(fixtures.MessageA1, fixtures.MessageB1, fixtures.MessageC1)
b := TypesOf(fixtures.MessageB1, fixtures.MessageC1, fixtures.MessageD1)
c := TypesOf(fixtures.MessageC1, fixtures.MessageD1, fixtures.MessageE1)
a := TypesOf(CommandA1, CommandB1, CommandC1)
b := TypesOf(CommandB1, CommandC1, CommandD1)
c := TypesOf(CommandC1, CommandD1, CommandE1)

Expect(UnionT(a, b, c)).To(Equal(TypesOf(
fixtures.MessageA1,
fixtures.MessageB1,
fixtures.MessageC1,
fixtures.MessageD1,
fixtures.MessageE1,
CommandA1,
CommandB1,
CommandC1,
CommandD1,
CommandE1,
)))
})
})

Describe("func DiffT()", func() {
It("returns an empty set for identical sets", func() {
a := TypesOf(fixtures.MessageA1, fixtures.MessageB1)
b := TypesOf(fixtures.MessageA1, fixtures.MessageB1)
a := TypesOf(CommandA1, CommandB1)
b := TypesOf(CommandA1, CommandB1)
Expect(DiffT(a, b)).To(BeEmpty())
})

It("returns an the original set for disjoint sets", func() {
a := TypesOf(fixtures.MessageA1, fixtures.MessageB1)
b := TypesOf(fixtures.MessageC1, fixtures.MessageD1)
a := TypesOf(CommandA1, CommandB1)
b := TypesOf(CommandC1, CommandD1)
Expect(DiffT(a, b)).To(Equal(a))
})

It("returns the diff", func() {
a := TypesOf(fixtures.MessageA1, fixtures.MessageB1, fixtures.MessageC1)
b := TypesOf(fixtures.MessageB1, fixtures.MessageC1)
Expect(DiffT(a, b)).To(Equal(TypesOf(fixtures.MessageA1)))
a := TypesOf(CommandA1, CommandB1, CommandC1)
b := TypesOf(CommandB1, CommandC1)
Expect(DiffT(a, b)).To(Equal(TypesOf(CommandA1)))
})
})

Expand Down

0 comments on commit 1bfa701

Please sign in to comment.