Skip to content

Commit

Permalink
feat: add test to reconnect components
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienaury committed Mar 22, 2024
1 parent c0f294f commit e62665c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pkg/silo/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,32 @@ func TestPartialMissing(t *testing.T) {

require.NoError(t, driver.Dump())
}

func TestReconnect(t *testing.T) {
t.Parallel()

rows := []silo.DataRow{
{"ID1": 1, "ID4": "00001"},
{"ID2": "1", "ID3": 1.10},
}
input := silo.NewDataRowReaderInMemory(rows)

backend := silo.NewBackendInMemory()
writer := silo.NewDumpToStdout()
driver := silo.NewDriver(backend, writer)

err := driver.Scan(input)
require.NoError(t, err)

require.NoError(t, driver.Dump())

rows = []silo.DataRow{
{"ID1": 1, "ID2": "1"},
}
input = silo.NewDataRowReaderInMemory(rows)

err = driver.Scan(input)
require.NoError(t, err)

require.NoError(t, driver.Dump())
}

0 comments on commit e62665c

Please sign in to comment.