Error handling, testing

This commit is contained in:
Jakob Borg
2013-12-20 00:01:34 +01:00
parent eba1c9e649
commit f5987fba32
6 changed files with 207 additions and 35 deletions

View File

@@ -47,7 +47,7 @@ var testDataExpected = map[string]File{
func TestUpdateLocal(t *testing.T) {
m := NewModel("foo")
fs := Walk("testdata", m)
fs := Walk("testdata", m, false)
m.ReplaceLocal(fs)
if len(m.need) > 0 {
@@ -89,7 +89,7 @@ func TestUpdateLocal(t *testing.T) {
func TestRemoteUpdateExisting(t *testing.T) {
m := NewModel("foo")
fs := Walk("testdata", m)
fs := Walk("testdata", m, false)
m.ReplaceLocal(fs)
newFile := protocol.FileInfo{
@@ -106,7 +106,7 @@ func TestRemoteUpdateExisting(t *testing.T) {
func TestRemoteAddNew(t *testing.T) {
m := NewModel("foo")
fs := Walk("testdata", m)
fs := Walk("testdata", m, false)
m.ReplaceLocal(fs)
newFile := protocol.FileInfo{
@@ -123,7 +123,7 @@ func TestRemoteAddNew(t *testing.T) {
func TestRemoteUpdateOld(t *testing.T) {
m := NewModel("foo")
fs := Walk("testdata", m)
fs := Walk("testdata", m, false)
m.ReplaceLocal(fs)
oldTimeStamp := int64(1234)
@@ -141,7 +141,7 @@ func TestRemoteUpdateOld(t *testing.T) {
func TestDelete(t *testing.T) {
m := NewModel("foo")
fs := Walk("testdata", m)
fs := Walk("testdata", m, false)
m.ReplaceLocal(fs)
if l1, l2 := len(m.local), len(fs); l1 != l2 {
@@ -231,7 +231,7 @@ func TestDelete(t *testing.T) {
func TestForgetNode(t *testing.T) {
m := NewModel("foo")
fs := Walk("testdata", m)
fs := Walk("testdata", m, false)
m.ReplaceLocal(fs)
if l1, l2 := len(m.local), len(fs); l1 != l2 {