Documentation ¶
Overview ¶
Package testutil contains shared test functionality
Index ¶
- func AssertAfter(t *testing.T, t1, t2 time.Time)
- func AssertDeepEquals(t *testing.T, values ...any)
- func AssertEmptyString(t *testing.T, s string)
- func AssertEqualsInAnyOrder(t *testing.T, actual []string, expected []string)
- func AssertError(t *testing.T, err error)
- func AssertErrorMessageContains(t *testing.T, err error, msg string, args ...any)
- func AssertFalse(t *testing.T, b bool)
- func AssertIntEqual(t *testing.T, ai, ei int)
- func AssertLen(t *testing.T, x any, el int)
- func AssertMajorVersionInHandshake(t *testing.T, handshake []byte, major byte)
- func AssertNeo4jError(t *testing.T, err error)
- func AssertNextOnlyError(t *testing.T, rec *db.Record, sum *db.Summary, err error)
- func AssertNextOnlyRecord(t *testing.T, rec *db.Record, sum *db.Summary, err error)
- func AssertNextOnlySummary(t *testing.T, rec *db.Record, sum *db.Summary, err error)
- func AssertNil(t *testing.T, x any)
- func AssertNoError(t *testing.T, err error)
- func AssertNotNil(t *testing.T, x any)
- func AssertPanics(t *testing.T, f func())
- func AssertSameType(t *testing.T, x, y any)
- func AssertSliceEqual(t *testing.T, x, y any)
- func AssertStringContain(t *testing.T, s, sub string)
- func AssertStringEqual(t *testing.T, as, es string)
- func AssertStringNotEmpty(t *testing.T, s string)
- func AssertTrue(t *testing.T, b bool)
- func AssertVersionInHandshake(t *testing.T, handshake []byte, major, minor byte)
- func AssertWriteSucceeds(t *testing.T, w io.Writer, b []byte)
- type ConnFake
- func (c *ConnFake) Birthdate() time.Time
- func (c *ConnFake) Bookmark() string
- func (c *ConnFake) Buffer(context.Context, idb.StreamHandle) error
- func (c *ConnFake) Close(ctx context.Context)
- func (c *ConnFake) Connect(context.Context, int, map[string]any, string, map[string]string) error
- func (c *ConnFake) Consume(context.Context, idb.StreamHandle) (*db.Summary, error)
- func (c *ConnFake) ForceReset(context.Context)
- func (c *ConnFake) GetRoutingTable(_ context.Context, _ map[string]string, _ []string, database, _ string) (*idb.RoutingTable, error)
- func (c *ConnFake) HasFailed() bool
- func (c *ConnFake) IdleDate() time.Time
- func (c *ConnFake) IsAlive() bool
- func (c *ConnFake) Keys(idb.StreamHandle) ([]string, error)
- func (c *ConnFake) Next(context.Context, idb.StreamHandle) (*db.Record, *db.Summary, error)
- func (c *ConnFake) Reset(context.Context)
- func (c *ConnFake) Run(_ context.Context, _ idb.Command, txConfig idb.TxConfig) (idb.StreamHandle, error)
- func (c *ConnFake) RunTx(context.Context, idb.TxHandle, idb.Command) (idb.StreamHandle, error)
- func (c *ConnFake) SelectDatabase(database string)
- func (c *ConnFake) ServerName() string
- func (c *ConnFake) ServerVersion() string
- func (c *ConnFake) SetBoltLogger(log.BoltLogger)
- func (c *ConnFake) TxBegin(_ context.Context, txConfig idb.TxConfig) (idb.TxHandle, error)
- func (c *ConnFake) TxCommit(context.Context, idb.TxHandle) error
- func (c *ConnFake) TxRollback(context.Context, idb.TxHandle) error
- func (c *ConnFake) Version() db.ProtocolVersion
- type Next
- type PoolFake
- type RecordedTx
- type RouterFake
- func (r *RouterFake) CleanUp(ctx context.Context) error
- func (r *RouterFake) GetNameOfDefaultDatabase(ctx context.Context, bookmarks []string, user string, ...) (string, error)
- func (r *RouterFake) Invalidate(ctx context.Context, database string) error
- func (r *RouterFake) InvalidateReader(ctx context.Context, database string, server string) error
- func (r *RouterFake) InvalidateWriter(context.Context, string, string) error
- func (r *RouterFake) Readers(ctx context.Context, bookmarksFn func(context.Context) ([]string, error), ...) ([]string, error)
- func (r *RouterFake) Writers(ctx context.Context, bookmarksFn func(context.Context) ([]string, error), ...) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDeepEquals ¶
func AssertEmptyString ¶
func AssertEqualsInAnyOrder ¶
func AssertError ¶
func AssertFalse ¶
func AssertIntEqual ¶
func AssertNeo4jError ¶
func AssertNextOnlyError ¶
func AssertNextOnlyRecord ¶
func AssertNextOnlySummary ¶
func AssertNoError ¶
func AssertNotNil ¶
func AssertPanics ¶
func AssertSameType ¶
func AssertSliceEqual ¶
func AssertStringContain ¶
func AssertStringEqual ¶
func AssertStringNotEmpty ¶
func AssertTrue ¶
Types ¶
type ConnFake ¶
type ConnFake struct { Name string ConnectionVersion db.ProtocolVersion Alive bool Birth time.Time Table *idb.RoutingTable Err error Id int TxBeginErr error TxBeginHandle idb.TxHandle RunErr error RunStream idb.StreamHandle RunTxErr error RunTxStream idb.StreamHandle Nexts []Next Bookm string TxCommitErr error TxCommitHook func() TxRollbackErr error ConsumeSum *db.Summary ConsumeErr error ConsumeHook func() RecordedTxs []RecordedTx // Appended to by Run/TxBegin BufferErr error BufferHook func() DatabaseName string Idle time.Time ServerVersionValue string ForceResetHook func() }
func (*ConnFake) ForceReset ¶
func (*ConnFake) GetRoutingTable ¶
func (*ConnFake) SelectDatabase ¶
func (*ConnFake) ServerName ¶
func (*ConnFake) ServerVersion ¶
func (*ConnFake) SetBoltLogger ¶
func (c *ConnFake) SetBoltLogger(log.BoltLogger)
func (*ConnFake) Version ¶
func (c *ConnFake) Version() db.ProtocolVersion
type PoolFake ¶
type PoolFake struct { BorrowConn db.Connection BorrowErr error ReturnHook func() CleanUpHook func() BorrowHook func() (db.Connection, error) }
type RecordedTx ¶
type RouterFake ¶
type RouterFake struct { Invalidated bool InvalidatedDb string ReadersRet []string ReadersHook func(bookmarks func(context.Context) ([]string, error), database string) ([]string, error) WritersRet []string WritersHook func(bookmarks func(context.Context) ([]string, error), database string) ([]string, error) Err error CleanUpHook func() GetNameOfDefaultDbHook func(user string) (string, error) InvalidatedServer string }
func (*RouterFake) GetNameOfDefaultDatabase ¶
func (r *RouterFake) GetNameOfDefaultDatabase(ctx context.Context, bookmarks []string, user string, boltLogger log.BoltLogger) (string, error)
func (*RouterFake) Invalidate ¶
func (r *RouterFake) Invalidate(ctx context.Context, database string) error
func (*RouterFake) InvalidateReader ¶
func (*RouterFake) InvalidateWriter ¶
Click to show internal directories.
Click to hide internal directories.